diff options
| author | Werner Koch <[email protected]> | 1998-07-06 10:23:57 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 1998-07-06 10:23:57 +0000 |
| commit | a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c (patch) | |
| tree | e159c79b615fcdcb65f31ee5d1d0a2b1ba84e9aa /g10/skclist.c | |
| parent | partly added creation of OP partial length headers (diff) | |
| download | gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.tar.gz gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.zip | |
intermediate release
Diffstat (limited to 'g10/skclist.c')
| -rw-r--r-- | g10/skclist.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/g10/skclist.c b/g10/skclist.c index 7082a2caa..efd97f3d1 100644 --- a/g10/skclist.c +++ b/g10/skclist.c @@ -56,13 +56,14 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock, PKT_secret_key *sk; sk = m_alloc_clear( sizeof *sk ); + sk->pubkey_usage = usage; if( (rc = get_seckey_byname( sk, NULL, unlock )) ) { free_secret_key( sk ); sk = NULL; log_error("no default secret key: %s\n", g10_errstr(rc) ); } else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, usage)) ) { SK_LIST r; - if( sk->version == 4 && (usage & 1) + if( sk->version == 4 && (usage & PUBKEY_USAGE_SIG) && sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) { log_error("this is a PGP generated " "ElGamal key which is NOT secure for signatures!\n"); @@ -86,13 +87,14 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock, PKT_secret_key *sk; sk = m_alloc_clear( sizeof *sk ); + sk->pubkey_usage = usage; if( (rc = get_seckey_byname( sk, locusr->d, unlock )) ) { free_secret_key( sk ); sk = NULL; log_error("skipped '%s': %s\n", locusr->d, g10_errstr(rc) ); } else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, usage)) ) { SK_LIST r; - if( sk->version == 4 && (usage & 1) + if( sk->version == 4 && (usage & PUBKEY_USAGE_SIG) && sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) { log_info("skipped '%s': this is a PGP generated " "ElGamal key which is not secure for signatures!\n", |
