diff options
author | Werner Koch <wk@gnupg.org> | 1998-04-08 21:49:02 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-04-08 21:49:02 +0200 |
commit | 8b10a87908f4d382735a046e7d043ebc250d8d67 (patch) | |
tree | 9c4255d5cd84df663f9a7001b7b6277e53cf6e6e /g10/skclist.c | |
parent | New tests (diff) | |
download | gnupg2-8b10a87908f4d382735a046e7d043ebc250d8d67.tar.xz gnupg2-8b10a87908f4d382735a046e7d043ebc250d8d67.zip |
test release
Diffstat (limited to 'g10/skclist.c')
-rw-r--r-- | g10/skclist.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/skclist.c b/g10/skclist.c index 53941cbfe..6d34b05bf 100644 --- a/g10/skclist.c +++ b/g10/skclist.c @@ -46,7 +46,8 @@ release_skc_list( SKC_LIST skc_list ) } int -build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock ) +build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock, + unsigned usage ) { SKC_LIST skc_list = NULL; int rc; @@ -59,8 +60,12 @@ build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock ) free_secret_cert( skc ); skc = NULL; log_error("no default secret key: %s\n", g10_errstr(rc) ); } - else if( !(rc=check_pubkey_algo(skc->pubkey_algo)) ) { + else if( !(rc=check_pubkey_algo2(skc->pubkey_algo, usage)) ) { SKC_LIST r; + if( skc->version == 4 && (usage & 1) + && skc->pubkey_algo == PUBKEY_ALGO_ELGAMAL ) + log_info("WARNING: This is probably a PGP generated " + "ElGamal key which is NOT secure for signatures!\n"); r = m_alloc( sizeof *r ); r->skc = skc; skc = NULL; r->next = skc_list; @@ -81,8 +86,12 @@ build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock ) free_secret_cert( skc ); skc = NULL; log_error("skipped '%s': %s\n", locusr->d, g10_errstr(rc) ); } - else if( !(rc=check_pubkey_algo(skc->pubkey_algo)) ) { + else if( !(rc=check_pubkey_algo2(skc->pubkey_algo, usage)) ) { SKC_LIST r; + if( skc->version == 4 && (usage & 1) + && skc->pubkey_algo == PUBKEY_ALGO_ELGAMAL ) + log_info("WARNING: This is probably a PGP generated " + "ElGamal key which is NOT secure for signatures!\n"); r = m_alloc( sizeof *r ); r->skc = skc; skc = NULL; r->next = skc_list; |