FAQ | This is a LIVE service | Changelog

Commit ae883d7f authored by Tony Finch's avatar Tony Finch

regpg: gpg2 compatibility for clean_ids

The key id format in the `regpg ls` output from gpg1 is like

    pub   4096R/15A1230B57A17C89 2017-11-02

and from gpg2 it is like

    pub   rsa4096/15A1230B57A17C89 2017-11-02 [SC]

Previously regpg would only strip off digits followed by one letter
then a slash. Now regpg strips off any alphanumeric+slash prefix.
parent 0e2362f5
......@@ -348,7 +348,7 @@ sub self_keys {
}
sub clean_ids {
return map { s{^\d+\w/}{}r } @_;
return map { s{^\w+/}{}r } @_;
}
sub add_keys {
......
......@@ -35,9 +35,12 @@ subtest 'list keys (one)' => sub {
works 'import key two', '' => qw(regpg addkey), $k2;
my $id1;
my $id2;
subtest 'list keys (both)' => sub {
checklist like => [ $k1, $k2 ],
unlike => [ $kd ];
($id1,$id2) = $stdout =~ m{^pub +(\w+/\w+)}gm;
};
subtest 'list keys (error cases)' => sub {
......@@ -51,6 +54,8 @@ subtest 'list keys (error cases)' => sub {
gpg_batch_yes;
works 'delete key one', '' => qw(regpg delkey), $k1;
works 'add key one by id', '' => qw(regpg addkey), $id1;
works 'delete key one by id', '' => qw(regpg delkey), $id1;
unlink $gpgconf;
subtest 'list keys (two)' => sub {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment