summaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-04-07 20:16:10 +0200
committerWerner Koch <wk@gnupg.org>1998-04-07 20:16:10 +0200
commit86f261dbc50544d73e4b9ae71fcbc2c6df5b9612 (patch)
treed3ba75484a73e1fe891f7ff862ab1f3722cb126c /g10/getkey.c
parentcast5 does now work (diff)
downloadgnupg2-86f261dbc50544d73e4b9ae71fcbc2c6df5b9612.tar.xz
gnupg2-86f261dbc50544d73e4b9ae71fcbc2c6df5b9612.zip
cipher reorganisiert
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index edc5c8355..7868df951 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -554,6 +554,7 @@ lookup( PKT_public_cert *pkc, int mode, u32 *keyid, const char *name )
int rc;
KBNODE keyblock = NULL;
KBPOS kbpos;
+ int oldmode = set_packet_list_mode(0);
rc = enum_keyblocks( 0, &kbpos, &keyblock );
if( rc ) {
@@ -655,6 +656,7 @@ lookup( PKT_public_cert *pkc, int mode, u32 *keyid, const char *name )
leave:
enum_keyblocks( 2, &kbpos, &keyblock ); /* close */
release_kbnode( keyblock );
+ set_packet_list_mode(oldmode);
return rc;
}
@@ -667,11 +669,12 @@ lookup_skc( PKT_secret_cert *skc, int mode, u32 *keyid, const char *name )
int rc;
KBNODE keyblock = NULL;
KBPOS kbpos;
+ int oldmode = set_packet_list_mode(0);
rc = enum_keyblocks( 5 /* open secret */, &kbpos, &keyblock );
if( rc ) {
if( rc == -1 )
- rc = G10ERR_NO_PUBKEY;
+ rc = G10ERR_NO_SECKEY;
else if( rc )
log_error("enum_keyblocks(open secret) failed: %s\n", g10_errstr(rc) );
goto leave;
@@ -761,13 +764,14 @@ lookup_skc( PKT_secret_cert *skc, int mode, u32 *keyid, const char *name )
keyblock = NULL;
}
if( rc == -1 )
- rc = G10ERR_NO_PUBKEY;
+ rc = G10ERR_NO_SECKEY;
else if( rc )
log_error("enum_keyblocks(read) failed: %s\n", g10_errstr(rc));
leave:
enum_keyblocks( 2, &kbpos, &keyblock ); /* close */
release_kbnode( keyblock );
+ set_packet_list_mode(oldmode);
return rc;
}