mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
* import.c (import_one): Add a flag (from_sk) so we don't check prefs
on an autoconverted public key. The check should only happen on the sk size. Noted by Dirk Traulsen.
This commit is contained in:
parent
7211ee589a
commit
4f7b459a96
@ -1,3 +1,9 @@
|
|||||||
|
2006-06-12 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* import.c (import_one): Add a flag (from_sk) so we don't check
|
||||||
|
prefs on an autoconverted public key. The check should only
|
||||||
|
happen on the sk size. Noted by Dirk Traulsen.
|
||||||
|
|
||||||
2006-06-09 David Shaw <dshaw@jabberwocky.com>
|
2006-06-09 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keygen.c (gen_card_key): Add optional argument to return a
|
* keygen.c (gen_card_key): Add optional argument to return a
|
||||||
|
13
g10/import.c
13
g10/import.c
@ -66,7 +66,7 @@ static int read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root );
|
|||||||
static void revocation_present(KBNODE keyblock);
|
static void revocation_present(KBNODE keyblock);
|
||||||
static int import_one(const char *fname, KBNODE keyblock,struct stats_s *stats,
|
static int import_one(const char *fname, KBNODE keyblock,struct stats_s *stats,
|
||||||
unsigned char **fpr,size_t *fpr_len,
|
unsigned char **fpr,size_t *fpr_len,
|
||||||
unsigned int options);
|
unsigned int options,int from_sk);
|
||||||
static int import_secret_one( const char *fname, KBNODE keyblock,
|
static int import_secret_one( const char *fname, KBNODE keyblock,
|
||||||
struct stats_s *stats, unsigned int options);
|
struct stats_s *stats, unsigned int options);
|
||||||
static int import_revoke_cert( const char *fname, KBNODE node,
|
static int import_revoke_cert( const char *fname, KBNODE node,
|
||||||
@ -256,7 +256,7 @@ import( IOBUF inp, const char* fname,struct stats_s *stats,
|
|||||||
|
|
||||||
while( !(rc = read_block( inp, &pending_pkt, &keyblock) )) {
|
while( !(rc = read_block( inp, &pending_pkt, &keyblock) )) {
|
||||||
if( keyblock->pkt->pkttype == PKT_PUBLIC_KEY )
|
if( keyblock->pkt->pkttype == PKT_PUBLIC_KEY )
|
||||||
rc = import_one( fname, keyblock, stats, fpr, fpr_len, options );
|
rc = import_one( fname, keyblock, stats, fpr, fpr_len, options, 0);
|
||||||
else if( keyblock->pkt->pkttype == PKT_SECRET_KEY )
|
else if( keyblock->pkt->pkttype == PKT_SECRET_KEY )
|
||||||
rc = import_secret_one( fname, keyblock, stats, options );
|
rc = import_secret_one( fname, keyblock, stats, options );
|
||||||
else if( keyblock->pkt->pkttype == PKT_SIGNATURE
|
else if( keyblock->pkt->pkttype == PKT_SIGNATURE
|
||||||
@ -677,7 +677,8 @@ check_prefs(KBNODE keyblock)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
||||||
unsigned char **fpr,size_t *fpr_len,unsigned int options )
|
unsigned char **fpr,size_t *fpr_len,unsigned int options,
|
||||||
|
int from_sk )
|
||||||
{
|
{
|
||||||
PKT_public_key *pk;
|
PKT_public_key *pk;
|
||||||
PKT_public_key *pk_orig;
|
PKT_public_key *pk_orig;
|
||||||
@ -973,7 +974,7 @@ import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
|||||||
if(mod_key)
|
if(mod_key)
|
||||||
{
|
{
|
||||||
revocation_present(keyblock_orig);
|
revocation_present(keyblock_orig);
|
||||||
if(seckey_available(keyid)==0)
|
if(!from_sk && seckey_available(keyid)==0)
|
||||||
check_prefs(keyblock_orig);
|
check_prefs(keyblock_orig);
|
||||||
}
|
}
|
||||||
else if(new_key)
|
else if(new_key)
|
||||||
@ -997,7 +998,7 @@ import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
|||||||
}
|
}
|
||||||
|
|
||||||
revocation_present(keyblock);
|
revocation_present(keyblock);
|
||||||
if(seckey_available(keyid)==0)
|
if(!from_sk && seckey_available(keyid)==0)
|
||||||
check_prefs(keyblock);
|
check_prefs(keyblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1169,7 +1170,7 @@ import_secret_one( const char *fname, KBNODE keyblock,
|
|||||||
if(pub_keyblock)
|
if(pub_keyblock)
|
||||||
{
|
{
|
||||||
import_one(fname,pub_keyblock,stats,
|
import_one(fname,pub_keyblock,stats,
|
||||||
NULL,NULL,opt.import_options);
|
NULL,NULL,opt.import_options,1);
|
||||||
release_kbnode(pub_keyblock);
|
release_kbnode(pub_keyblock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user