summaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-02-16 21:05:02 +0100
committerWerner Koch <wk@gnupg.org>1998-02-16 21:05:02 +0100
commit82464369f664f821542c416d35d4013f9723f87a (patch)
treed127f2d891260ff1c6d4264630b2ba7bd463b1f4 /g10/getkey.c
parentadded option export (diff)
downloadgnupg2-82464369f664f821542c416d35d4013f9723f87a.tar.xz
gnupg2-82464369f664f821542c416d35d4013f9723f87a.zip
some import functionality
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 7182f4d4f..8f92f0a45 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -460,6 +460,7 @@ static int
scan_keyring( PKT_public_cert *pkc, u32 *keyid,
const char *name, const char *filename )
{
+ compress_filter_context_t cfx;
int rc=0;
int found = 0;
IOBUF a;
@@ -499,6 +500,19 @@ scan_keyring( PKT_public_cert *pkc, u32 *keyid,
log_error("Hmmm, pubkey without an user id in '%s'\n", filename);
goto leave;
}
+ else if( pkt.pkttype == PKT_COMPRESSED ) {
+ memset( &cfx, 0, sizeof cfx );
+ if( pkt.pkt.compressed->algorithm == 1 )
+ cfx.pgpmode = 1;
+ else if( pkt.pkt.compressed->algorithm != 2 ){
+ rc = G10ERR_COMPR_ALGO;
+ log_error("compressed keyring: %s\n", g10_errstr(rc) );
+ break;
+ }
+
+ pkt.pkt.compressed->buf = NULL;
+ iobuf_push_filter( a, compress_filter, &cfx );
+ }
else if( keyid && pkt.pkttype == PKT_PUBLIC_CERT ) {
switch( pkt.pkt.public_cert->pubkey_algo ) {
case PUBKEY_ALGO_ELGAMAL: