mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* options.h, main.h, g10.c (main), import.c (parse_import_options,
delete_inv_parts), keyserver.c (parse_keyserver_options): add new --import-options option. The only current flag is "allow-local-sigs". * g10.c (main): Don't disable MDC in pgp7 mode. * options.h, g10.c (main), keyserver.c (parse_keyserver_options): Remove old keyserver-option include-attributes now that there is an export-option for the same thing.
This commit is contained in:
parent
002f085c23
commit
125613737c
6 changed files with 91 additions and 12 deletions
43
g10/import.c
43
g10/import.c
|
@ -81,6 +81,48 @@ static int merge_keysigs( KBNODE dst, KBNODE src, int *n_sigs,
|
|||
const char *fname, u32 *keyid );
|
||||
|
||||
|
||||
int
|
||||
parse_import_options(char *str,unsigned int *options)
|
||||
{
|
||||
char *tok;
|
||||
int hit=0;
|
||||
struct
|
||||
{
|
||||
char *name;
|
||||
unsigned int bit;
|
||||
} import_opts[]=
|
||||
{
|
||||
{"allow-local-sigs",IMPORT_ALLOW_LOCAL_SIGS},
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
while((tok=strsep(&str," ,")))
|
||||
{
|
||||
int i,rev=0;
|
||||
|
||||
if(ascii_memcasecmp("no-",tok,3)==0)
|
||||
rev=1;
|
||||
|
||||
for(i=0;import_opts[i].name;i++)
|
||||
{
|
||||
if(ascii_strcasecmp(import_opts[i].name,tok)==0)
|
||||
{
|
||||
if(rev)
|
||||
*options&=~import_opts[i].bit;
|
||||
else
|
||||
*options|=import_opts[i].bit;
|
||||
hit=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!hit && !import_opts[i].name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return hit;
|
||||
}
|
||||
|
||||
void *
|
||||
import_new_stats_handle (void)
|
||||
{
|
||||
|
@ -1039,6 +1081,7 @@ delete_inv_parts( const char *fname, KBNODE keyblock, u32 *keyid )
|
|||
delete_kbnode( node ); /* build_packet() can't handle this */
|
||||
else if( node->pkt->pkttype == PKT_SIGNATURE &&
|
||||
!node->pkt->pkt.signature->flags.exportable &&
|
||||
!(opt.import_options&IMPORT_ALLOW_LOCAL_SIGS) &&
|
||||
seckey_available( node->pkt->pkt.signature->keyid ) ) {
|
||||
/* here we violate the rfc a bit by still allowing
|
||||
* to import non-exportable signature when we have the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue