No key data exported by gpgme_op_export_keys()
Dmitry Antipov
dantipov at cloudlinux.com
Thu Apr 15 19:28:53 CEST 2021
On 4/15/21 7:59 PM, Ingo Klöcker wrote:
> Are both keys in your actual public key ring?
$ gpg --list-packets < RPM-GPG-KEY-test
# off=0 ctb=99 tag=6 hlen=3 plen=525
:public key packet:
version 4, algo 1, created 1616661966, expires 0
pkey[0]: [4096 bits]
pkey[1]: [17 bits]
keyid: 1D66A1789477C523
# off=528 ctb=b4 tag=13 hlen=2 plen=38
:user ID packet: "CloudLinux, Inc. <info at cloudlinux.com>"
# off=568 ctb=89 tag=2 hlen=3 plen=596
:signature packet: algo 1, keyid 1D66A1789477C523
version 4, created 1616661966, md5len 0, sigclass 0x13
digest algo 8, begin of digest b6 63
hashed subpkt 33 len 21 (issuer fpr v4 10DFA0450487D8E6631738D41D66A1789477C523)
hashed subpkt 2 len 4 (sig created 2021-03-25)
hashed subpkt 27 len 1 (key flags: 01)
hashed subpkt 9 len 4 (key expires after 2y0d0h0m)
hashed subpkt 11 len 4 (pref-sym-algos: 9 8 7 2)
hashed subpkt 21 len 5 (pref-hash-algos: 10 9 8 11 2)
hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
hashed subpkt 30 len 1 (features: 01)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID 1D66A1789477C523)
data: [4095 bits]
# off=1167 ctb=b4 tag=13 hlen=2 plen=40
:user ID packet: "Dmitry Antipov <dantipov at cloudlinux.com>"
# off=1209 ctb=89 tag=2 hlen=3 plen=596
:signature packet: algo 1, keyid 1D66A1789477C523
version 4, created 1616662046, md5len 0, sigclass 0x13
digest algo 8, begin of digest b7 7b
hashed subpkt 33 len 21 (issuer fpr v4 10DFA0450487D8E6631738D41D66A1789477C523)
hashed subpkt 2 len 4 (sig created 2021-03-25)
hashed subpkt 27 len 1 (key flags: 01)
hashed subpkt 9 len 4 (key expires after 2y0d0h0m)
hashed subpkt 11 len 4 (pref-sym-algos: 9 8 7 2)
hashed subpkt 21 len 5 (pref-hash-algos: 10 9 8 11 2)
hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
hashed subpkt 30 len 1 (features: 01)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID 1D66A1789477C523)
data: [4096 bits]
# off=1808 ctb=b9 tag=14 hlen=3 plen=397
:public sub key packet:
version 4, algo 1, created 1616662014, expires 0
pkey[0]: [3072 bits]
pkey[1]: [17 bits]
keyid: AAD128E49907EA1B
# off=2208 ctb=89 tag=2 hlen=3 plen=1010
:signature packet: algo 1, keyid 1D66A1789477C523
version 4, created 1616662014, md5len 0, sigclass 0x18
digest algo 8, begin of digest 8c ca
hashed subpkt 33 len 21 (issuer fpr v4 10DFA0450487D8E6631738D41D66A1789477C523)
hashed subpkt 2 len 4 (sig created 2021-03-25)
hashed subpkt 27 len 1 (key flags: 02)
hashed subpkt 9 len 4 (key expires after 2y0d0h0m)
subpkt 16 len 8 (issuer key ID 1D66A1789477C523)
subpkt 32 len 435 (signature: v4, class 0x19, algo 1, digest algo 8)
data: [4095 bits]
$ ./t-gpgme-import RPM-GPG-KEY-test
1 key(s) found
read 4443 bytes of key(s) data:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBcTc4BEADF7NC6a5RPC0m6s6OXS4CEkkK6EKna7Vm9+dmSMWWuonZWQGH3
VG3Kd8GDymFHAAO8zBfm49XEt1qKi2tXghnsXKQVo4fj/vHCcGzzd3D62SFqkOr0
Q0DlNoNZGzht94ihmm095hegOLoQfyuFQ6wyn8ZK1Mg0dCgWwY5tq834FjMyeWJN
bweiQ+n/JvmOnM7ETO3p3vCXTPWdr/9i64CGbvnVDqhyl77TFj9GCPIvikKgePtq
Y0h9Rvh8F9jabzxE+vHNcLRQWjAqhs90gZK0ag78dXiPSt/lVmQ40GtScRqk8zgZ
csGfVqVOELUAVXbNOq1pBK36K5eNMrwHzPFNggIpxA2V2ccigfblghe7DnbqypxD
uXkf46lm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h91/M9qA5kd35Y+ElUugk
FOyGtoqvNVwaJ2C8Zj7af1aMyg//QQU3dOZyeoKUMh4Ajkq+bq+57IOGaDJE76En
VY4NRnOP434Hej/Fv/1cZSJPUERmz8LvxK7uxw0OdxcObTCLmp6Tjtp5i275knB6
fp5ex1dcRVHte5UjIoOS6FA5zfjCoVjau/2wOiBXiKsIzgDzxzxGXuYiOtbUVTrz
pBkuQXE+BRIgC2bzARZ8hKU7uUEshHGHRYq6BZkhbaG54czKrFvVHym1kmxKohSy
d5l1+AtFUaWpokyojgIG1hsvr6Sf1/m5KeBunU9RmlkwPSD98vzD3QKkKHggbDQh
8ltqze6pEFDWJkdYtPKpbObJ3Gu0dxjIibJiWWdiJDCm6Bu8hDJnWVAfclhsaOFg
y00SbkFfnDbWqGiFFWVAL2LkWZBsuuXGOStntrxt9vOWoBes+iZdX/MPSMm8Oy7H
9IB4LIltvhtnyyzn8sFfqfLXaotXr0+YlxZ4PhxxsTi9apJ4N2r5t4/6fOE7dNNh
nY77Uh7PYMXWgLAHPi8JcGP0wxiv8SlLh/9etpfbhew3gtnw+8qxuRyK3IMWZx0s
YvJAsk3NBQZVi1hh/xOOTLt/ezVy5iefKD8E/N26fnmFnhXlnaydx5pKpgorsegH
kNaUOsFFtc8QZRsB5H00MTw1eRhwmCREdPjJBobPKLHWeoHQfCWgx7j0mq7EtOrP
Syc7ScA=
=g1MT
-----END PGP PUBLIC KEY BLOCK-----
$ gpg --list-packets < RPM-GPG-KEY-fedora-33-primary
# off=0 ctb=99 tag=6 hlen=3 plen=525
:public key packet:
version 4, algo 1, created 1580205819, expires 0
pkey[0]: [4096 bits]
pkey[1]: [17 bits]
keyid: 49FD77499570FF31
# off=528 ctb=b4 tag=13 hlen=2 plen=49
:user ID packet: "Fedora (33) <fedora-33-primary at fedoraproject.org>"
# off=579 ctb=89 tag=2 hlen=3 plen=568
:signature packet: algo 1, keyid 49FD77499570FF31
version 4, created 1580205819, md5len 0, sigclass 0x13
digest algo 2, begin of digest 99 b6
hashed subpkt 2 len 4 (sig created 2020-01-28)
hashed subpkt 27 len 1 (key flags: 0F)
hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
hashed subpkt 30 len 1 (features: 01)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID 49FD77499570FF31)
data: [4095 bits]
$ ./t-gpgme-import RPM-GPG-KEY-fedora-33-primary
1 key(s) found
read 0 bytes of key(s) data:
> My guess is that the export needs the actual key data and that's not part of
> the result of the key list. The result of the key list only tells
> gpgme_op_export_keys() which keys you want to export.
If so, it seems that the API is just designed to shoot yourself in the foot.
> Try running your program with
> GPGME_DEBUG=<debug level>
> with one of the debug levels in src/debug.h
Thanks, will try it as well.
Dmitry
More information about the Gnupg-devel
mailing list