mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner Koch
This commit is contained in:
parent
a10fe4efb0
commit
881e513237
57 changed files with 1067 additions and 631 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <gcrypt.h>
|
||||
#include "options.h"
|
||||
#include "packet.h"
|
||||
#include "errors.h"
|
||||
|
@ -33,6 +34,7 @@
|
|||
#include "util.h"
|
||||
#include "i18n.h"
|
||||
#include "cipher.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
void
|
||||
|
@ -48,18 +50,6 @@ release_sk_list( SK_LIST sk_list )
|
|||
}
|
||||
|
||||
|
||||
/* Check that we are only using keys which don't have
|
||||
* the string "(insecure!)" or "not secure" or "do not use"
|
||||
* in one of the user ids
|
||||
*/
|
||||
static int
|
||||
is_insecure( PKT_secret_key *sk )
|
||||
{
|
||||
|
||||
return 0; /* FIXME!! */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock,
|
||||
unsigned use )
|
||||
|
@ -76,19 +66,14 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock,
|
|||
free_secret_key( sk ); sk = NULL;
|
||||
log_error("no default secret key: %s\n", g10_errstr(rc) );
|
||||
}
|
||||
else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, use)) ) {
|
||||
else if( !(rc=openpgp_pk_test_algo(sk->pubkey_algo, use)) ) {
|
||||
SK_LIST r;
|
||||
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
||||
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||
if( sk->version == 4 && (use & GCRY_PK_USAGE_SIGN)
|
||||
&& sk->pubkey_algo == GCRY_PK_ELG_E ) {
|
||||
log_info("this is a PGP generated "
|
||||
"ElGamal key which is NOT secure for signatures!\n");
|
||||
free_secret_key( sk ); sk = NULL;
|
||||
}
|
||||
else if( random_is_faked() && !is_insecure( sk ) ) {
|
||||
log_info(_("key is not flagged as insecure - "
|
||||
"can't use it with the faked RNG!\n"));
|
||||
free_secret_key( sk ); sk = NULL;
|
||||
}
|
||||
else {
|
||||
r = m_alloc( sizeof *r );
|
||||
r->sk = sk; sk = NULL;
|
||||
|
@ -112,20 +97,15 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock,
|
|||
free_secret_key( sk ); sk = NULL;
|
||||
log_error(_("skipped `%s': %s\n"), locusr->d, g10_errstr(rc) );
|
||||
}
|
||||
else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, use)) ) {
|
||||
else if( !(rc=openpgp_pk_test_algo(sk->pubkey_algo, use)) ) {
|
||||
SK_LIST r;
|
||||
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
||||
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||
if( sk->version == 4 && (use & GCRY_PK_USAGE_SIGN)
|
||||
&& sk->pubkey_algo == GCRY_PK_ELG_E ) {
|
||||
log_info(_("skipped `%s': this is a PGP generated "
|
||||
"ElGamal key which is not secure for signatures!\n"),
|
||||
locusr->d );
|
||||
free_secret_key( sk ); sk = NULL;
|
||||
}
|
||||
else if( random_is_faked() && !is_insecure( sk ) ) {
|
||||
log_info(_("key is not flagged as insecure - "
|
||||
"can't use it with the faked RNG!\n"));
|
||||
free_secret_key( sk ); sk = NULL;
|
||||
}
|
||||
else {
|
||||
r = m_alloc( sizeof *r );
|
||||
r->sk = sk; sk = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue