Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RBM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
RBM
Commits
bf35e085
Commit
bf35e085
authored
2 years ago
by
Richard Pospesel
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40049: gpg_keyring should allow for array of keyrings
parent
a6ccc103
No related branches found
Branches containing commit
No related tags found
1 merge request
!43
Bug 40049: gpg_keyring should allow for array of keyrings
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/RBM/DefaultConfig.pm
+33
-11
33 additions, 11 deletions
lib/RBM/DefaultConfig.pm
with
33 additions
and
11 deletions
lib/RBM/DefaultConfig.pm
+
33
−
11
View file @
bf35e085
...
...
@@ -157,18 +157,41 @@ our %default_config = (
gpg_bin
=>
'
gpg
',
gpg_args
=>
'',
gpg_allow_expired_keys
=>
0
,
gpg_keyring_
path
=>
sub
{
gpg_keyring_
args
=>
sub
{
my
(
$project
,
$options
)
=
@_
;
my
$gpg_keyring
=
RBM::
project_config
(
$project
,
'
gpg_keyring
',
$options
);
return
undef
unless
$gpg_keyring
;
return
$gpg_keyring
if
$gpg_keyring
=~
m|^/|
;
my
$rootpath
=
RBM::
rbm_path
("
keyring/
$gpg_keyring
");
return
$rootpath
if
-
f
$rootpath
;
for
my
$module
(
sort
keys
%
{
$
RBM::
config
->
{
modules
}})
{
my
$modulepath
=
RBM::
rbm_path
("
modules/
$module
/keyring/
$gpg_keyring
");
return
$modulepath
if
-
f
$modulepath
;
# handle both gpg_keyring being an array or a string
$gpg_keyring
=
ref
$gpg_keyring
eq
'
ARRAY
'
?
$gpg_keyring
:
[
$gpg_keyring
];
# construct list of keyring paths
my
@keyring_args
=
();
foreach
my
$current_keyring
(
@$gpg_keyring
)
{
# check for absolute path
if
(
$current_keyring
=~
m|^/|
)
{
push
(
@keyring_args
,
"
--keyring
$current_keyring
");
goto
FOUND_KEYRING
;
}
# check for existence in the keyring directory
my
$rootpath
=
RBM::
rbm_path
("
keyring/
$current_keyring
");
if
(
-
f
$rootpath
)
{
push
(
@keyring_args
,
"
--keyring
$rootpath
");
goto
FOUND_KEYRING
;
}
# check for keyring in module's keyring directory
for
my
$module
(
sort
keys
%
{
$
RBM::
config
->
{
modules
}})
{
my
$modulepath
=
RBM::
rbm_path
("
modules/
$module
/keyring/
$current_keyring
");
if
(
-
f
$modulepath
)
{
push
(
@keyring_args
,
"
--keyring
$modulepath
");
goto
FOUND_KEYRING
;
}
}
# fallthrough implies keyring file not found
RBM::
exit_error
("
keyring file
$current_keyring
is missing
");
FOUND_KEYRING:
}
RBM::
exit_error
("
keyring file
$gpg_keyring
is missing
")
my
$args
=
join
("
",
@keyring_args
);
return
$args
;
},
# Make it possible for gpg_wrapper to allow git tag signed using an expired
# key.
...
...
@@ -177,9 +200,8 @@ our %default_config = (
#!/bin/bash
export
LC_ALL
=
C
[
%
IF
c
('
gpg_keyring_path
');
SET
gpg_kr
=
'
--keyring
'
_
c
('
gpg_keyring_path
')
_
'
--no-default-keyring --no-auto-check-trustdb --trust-model always
';
IF
c
('
gpg_keyring_args
');
SET
gpg_kr
=
c
('
gpg_keyring_args
')
_
'
--no-default-keyring --no-auto-check-trustdb --trust-model always
';
END
;
-%
]
gpg_verify
=
0
...
...
This diff is collapsed.
Click to expand it.
morgan
@morgan
mentioned in issue
tor-browser-build#40645 (closed)
·
2 years ago
mentioned in issue
tor-browser-build#40645 (closed)
mentioned in issue tor-browser-build#40645
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment