diff options
Diffstat (limited to 'g10/getkey.c')
-rw-r--r-- | g10/getkey.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index 09633c98a..975d567fe 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1881,14 +1881,23 @@ premerge_public_with_secret ( KBNODE pubblock, KBNODE secblock ) for (sec=secblock->next; sec; sec = sec->next ) { if ( sec->pkt->pkttype == PKT_SECRET_SUBKEY ) { PKT_secret_key *sk = sec->pkt->pkt.secret_key; - if ( !cmp_public_secret_key ( pk, sk ) ) + if ( !cmp_public_secret_key ( pk, sk ) ) { + if ( sk->protect.s2k.mode == 1001 ) { + /* The secret parts are not available so + we can't use that key for signing etc. + Fix the pubkey usage */ + pk->pubkey_usage &= ~PUBKEY_USAGE_SIG; + } break; + } } } if ( !sec ) { KBNODE next, ll; - log_error ( "no corresponding secret subkey " - "for public subkey - removing\n" ); + + log_info ( "no secret subkey " + "for public subkey %08lX - ignoring\n", + (ulong)keyid_from_pk (pk,NULL) ); /* we have to remove the subkey in this case */ assert ( last ); /* find the next subkey */ |