diff options
author | David Shaw <[email protected]> | 2004-02-14 01:54:12 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-02-14 01:54:12 +0000 |
commit | f407bb6a97301424766c85401e885e46deb5fd14 (patch) | |
tree | b4456e008e8c8cbe7b496293e37aad814bd9f3a7 | |
parent | * gnupg.7: Clarify that 'gpgv' doesn't encrypt, and that's not a bug. (diff) | |
download | gnupg-f407bb6a97301424766c85401e885e46deb5fd14.tar.gz gnupg-f407bb6a97301424766c85401e885e46deb5fd14.zip |
* import.c (check_prefs): Some language fixes. (sec_to_pub_keyblock,
import_secret_one): Without knowing the number of MPIs there are, we
cannot try and sk-to-pk-ize a key.
-rw-r--r-- | g10/ChangeLog | 6 | ||||
-rw-r--r-- | g10/import.c | 22 |
2 files changed, 21 insertions, 7 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index a7c84d1fd..d0051ddcd 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,9 @@ +2004-02-13 David Shaw <[email protected]> + + * import.c (check_prefs): Some language fixes. + (sec_to_pub_keyblock, import_secret_one): Without knowing the + number of MPIs there are, we cannot try and sk-to-pk-ize a key. + 2004-02-12 David Shaw <[email protected]> * import.c (check_prefs): New function to check preferences on a diff --git a/g10/import.c b/g10/import.c index d57ae6c9e..9b368f681 100644 --- a/g10/import.c +++ b/g10/import.c @@ -608,10 +608,10 @@ check_prefs(KBNODE keyblock) if(problem) { - log_info(_("It strongly suggested that you update" - " your preferences and re-distribute\n")); - log_info(_("this key to avoid potential algorithm" - " mismatch problems.\n")); + log_info(_("it is strongly suggested that you update" + " your preferences and\n")); + log_info(_("re-distribute this key to avoid potential algorithm" + " mismatch problems\n")); if(!opt.batch) { @@ -956,7 +956,12 @@ sec_to_pub_keyblock(KBNODE sec_keyblock) n=pubkey_get_npkey(pk->pubkey_algo); if(n==0) - pk->pkey[0]=mpi_copy(sk->skey[0]); + { + /* we can't properly extract the pubkey without knowing + the number of MPIs */ + release_kbnode(pub_keyblock); + return NULL; + } else { int i; @@ -1062,8 +1067,11 @@ import_secret_one( const char *fname, KBNODE keyblock, /* Try and make a public key out of this. */ KBNODE pub_keyblock=sec_to_pub_keyblock(keyblock); - import_one(fname,pub_keyblock,stats,opt.import_options); - release_kbnode(pub_keyblock); + if(pub_keyblock) + { + import_one(fname,pub_keyblock,stats,opt.import_options); + release_kbnode(pub_keyblock); + } } /* Now that the key is definitely incorporated into the keydb, |