1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

See ChangeLog: Thu Jul 15 10:15:35 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-07-15 08:16:46 +00:00
parent 40f2d9f830
commit a316550579
13 changed files with 122 additions and 8 deletions

View file

@ -54,7 +54,7 @@ struct pubkey_table_s {
};
static struct pubkey_table_s pubkey_table[TABLE_SIZE];
static int disabled_algos[TABLE_SIZE];
static int
@ -267,6 +267,20 @@ pubkey_algo_to_string( int algo )
}
void
disable_pubkey_algo( int algo )
{
int i;
for(i=0; i < DIM(disabled_algos); i++ ) {
if( !disabled_algos[i] || disabled_algos[i] == algo ) {
disabled_algos[i] = algo;
return;
}
}
log_fatal("can't disable pubkey algo %d: table full\n");
}
int
check_pubkey_algo( int algo )
@ -291,6 +305,11 @@ check_pubkey_algo2( int algo, unsigned use )
if( (use & PUBKEY_USAGE_ENC)
&& !(pubkey_table[i].use & PUBKEY_USAGE_ENC) )
return G10ERR_WR_PUBKEY_ALGO;
for(i=0; i < DIM(disabled_algos); i++ ) {
if( disabled_algos[i] == algo )
return G10ERR_PUBKEY_ALGO;
}
return 0; /* okay */
}
} while( load_pubkey_modules() );