diff options
author | Werner Koch <[email protected]> | 2014-08-18 10:55:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-08-18 10:55:29 +0000 |
commit | e4aa006e4807285ffdd881e4e05af3bc47c5c964 (patch) | |
tree | d180395ecca165473872a5545da5fee6699906e2 /kbx/keybox-blob.c | |
parent | gpg: Change default cipher for --symmetric from CAST5 to AES-128. (diff) | |
download | gnupg-e4aa006e4807285ffdd881e4e05af3bc47c5c964.tar.gz gnupg-e4aa006e4807285ffdd881e4e05af3bc47c5c964.zip |
kbx: Make user id and signature data optional for OpenPGP.
* kbx/keybox-blob.c (_keybox_create_openpgp_blob): Remove restriction.
--
Although self-signature and key binding signatures are required by
OpenPGP, we should not enforce that in the storage backend.
Diffstat (limited to 'kbx/keybox-blob.c')
-rw-r--r-- | kbx/keybox-blob.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c index ebbcdf8ff..f7abb6ccd 100644 --- a/kbx/keybox-blob.c +++ b/kbx/keybox-blob.c @@ -702,9 +702,6 @@ _keybox_create_openpgp_blob (KEYBOXBLOB *r_blob, *r_blob = NULL; - if (!info->nuids || !info->nsigs) - return gpg_error (GPG_ERR_BAD_PUBKEY); - /* If we have a signature status vector, check that the number of elements matches the actual number of signatures. */ if (sigstatus && sigstatus[0] != info->nsigs) @@ -721,19 +718,27 @@ _keybox_create_openpgp_blob (KEYBOXBLOB *r_blob, err = gpg_error_from_syserror (); goto leave; } + blob->nuids = info->nuids; - blob->uids = xtrycalloc (blob->nuids, sizeof *blob->uids ); - if (!blob->uids) + if (blob->nuids) { - err = gpg_error_from_syserror (); - goto leave; + blob->uids = xtrycalloc (blob->nuids, sizeof *blob->uids ); + if (!blob->uids) + { + err = gpg_error_from_syserror (); + goto leave; + } } + blob->nsigs = info->nsigs; - blob->sigs = xtrycalloc (blob->nsigs, sizeof *blob->sigs ); - if (!blob->sigs) + if (blob->nsigs) { - err = gpg_error_from_syserror (); - goto leave; + blob->sigs = xtrycalloc (blob->nsigs, sizeof *blob->sigs ); + if (!blob->sigs) + { + err = gpg_error_from_syserror (); + goto leave; + } } err = pgp_create_key_part (blob, info); |