mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-22 19:58:29 +01:00
* delkey.c (do_delete_key): Allow deleting a public key with a secret
present if --expert is set. * plaintext.c (handle_plaintext): Make bytecount static so it works with multiple literal packets inside a message. * encode.c, helptext.c (keygen.algo, keygen.algo.elg_se), keygen.c (ask_algo), sig-check.c (do_check_messages), skclist.c (build_sk_list): Rename "ElGamal" to "Elgamal" as that is the proper spelling nowadays. Suggested by Jon Callas.
This commit is contained in:
parent
0d7cae4663
commit
f2148f03c5
@ -1,3 +1,16 @@
|
|||||||
|
2004-02-25 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* delkey.c (do_delete_key): Allow deleting a public key with a
|
||||||
|
secret present if --expert is set.
|
||||||
|
|
||||||
|
* plaintext.c (handle_plaintext): Make bytecount static so it
|
||||||
|
works with multiple literal packets inside a message.
|
||||||
|
|
||||||
|
* encode.c, helptext.c (keygen.algo, keygen.algo.elg_se), keygen.c
|
||||||
|
(ask_algo), sig-check.c (do_check_messages), skclist.c
|
||||||
|
(build_sk_list): Rename "ElGamal" to "Elgamal" as that is the
|
||||||
|
proper spelling nowadays. Suggested by Jon Callas.
|
||||||
|
|
||||||
2004-02-24 David Shaw <dshaw@jabberwocky.com>
|
2004-02-24 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* plaintext.c: Copyright.
|
* plaintext.c: Copyright.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* delkey.c - delete keys
|
/* delkey.c - delete keys
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
||||||
|
* 2004 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -98,7 +99,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail )
|
|||||||
pk = node->pkt->pkt.public_key;
|
pk = node->pkt->pkt.public_key;
|
||||||
keyid_from_pk( pk, keyid );
|
keyid_from_pk( pk, keyid );
|
||||||
rc = seckey_available( keyid );
|
rc = seckey_available( keyid );
|
||||||
if( !rc ) {
|
if( !rc && !opt.expert ) {
|
||||||
*r_sec_avail = 1;
|
*r_sec_avail = 1;
|
||||||
rc = -1;
|
rc = -1;
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -802,7 +802,7 @@ write_pubkey_enc_from_list( PK_LIST pk_list, DEK *dek, IOBUF out )
|
|||||||
* algorithm number PK->PUBKEY_ALGO and pass it to pubkey_encrypt
|
* algorithm number PK->PUBKEY_ALGO and pass it to pubkey_encrypt
|
||||||
* which returns the encrypted value in the array ENC->DATA.
|
* which returns the encrypted value in the array ENC->DATA.
|
||||||
* This array has a size which depends on the used algorithm
|
* This array has a size which depends on the used algorithm
|
||||||
* (e.g. 2 for ElGamal). We don't need frame anymore because we
|
* (e.g. 2 for Elgamal). We don't need frame anymore because we
|
||||||
* have everything now in enc->data which is the passed to
|
* have everything now in enc->data which is the passed to
|
||||||
* build_packet()
|
* build_packet()
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* helptext.c - English help texts
|
/* helptext.c - English help texts
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
||||||
|
* 2004 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -71,29 +72,17 @@ static struct helptexts { const char *key; const char *help; } helptexts[] = {
|
|||||||
{ "keygen.algo", N_(
|
{ "keygen.algo", N_(
|
||||||
"Select the algorithm to use.\n"
|
"Select the algorithm to use.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"DSA (aka DSS) is the digital signature algorithm which can only be used\n"
|
"DSA (aka DSS) is the Digital Signature Algorithm and can only be used\n"
|
||||||
"for signatures. This is the suggested algorithm because verification of\n"
|
"for signatures.\n"
|
||||||
"DSA signatures are much faster than those of ElGamal.\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"ElGamal is an algorithm which can be used for signatures and encryption.\n"
|
"Elgamal is an encrypt-only algorithm.\n"
|
||||||
"OpenPGP distinguishs between two flavors of this algorithms: an encrypt only\n"
|
|
||||||
"and a sign+encrypt; actually it is the same, but some parameters must be\n"
|
|
||||||
"selected in a special way to create a safe key for signatures: this program\n"
|
|
||||||
"does this but other OpenPGP implementations are not required to understand\n"
|
|
||||||
"the signature+encryption flavor.\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"The first (primary) key must always be a key which is capable of signing;\n"
|
"RSA may be used for signatures or encryption.\n"
|
||||||
"this is the reason why the encryption only ElGamal key is not available in\n"
|
"\n"
|
||||||
"this menu."
|
"The first (primary) key must always be a key which is capable of signing."
|
||||||
)},
|
)},
|
||||||
|
|
||||||
|
|
||||||
{ "keygen.algo.elg_se", N_(
|
|
||||||
"Although these keys are defined in RFC2440 they are not suggested\n"
|
|
||||||
"because they are not supported by all programs and signatures created\n"
|
|
||||||
"with them are quite large and very slow to verify."
|
|
||||||
)},
|
|
||||||
|
|
||||||
{ "keygen.algo.rsa_se", N_(
|
{ "keygen.algo.rsa_se", N_(
|
||||||
"In general it is not a good idea to use the same key for signing and\n"
|
"In general it is not a good idea to use the same key for signing and\n"
|
||||||
"encryption. This algorithm should only be used in certain domains.\n"
|
"encryption. This algorithm should only be used in certain domains.\n"
|
||||||
|
@ -1041,7 +1041,7 @@ check_valid_days( const char *s )
|
|||||||
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* Returns: 0 to create both a DSA and a ElGamal key.
|
* Returns: 0 to create both a DSA and a Elgamal key.
|
||||||
* and only if key flags are to be written the desired usage.
|
* and only if key flags are to be written the desired usage.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@ -1053,10 +1053,10 @@ ask_algo (int addmode, unsigned int *r_usage)
|
|||||||
*r_usage = 0;
|
*r_usage = 0;
|
||||||
tty_printf(_("Please select what kind of key you want:\n"));
|
tty_printf(_("Please select what kind of key you want:\n"));
|
||||||
if( !addmode )
|
if( !addmode )
|
||||||
tty_printf(_(" (%d) DSA and ElGamal (default)\n"), 1 );
|
tty_printf(_(" (%d) DSA and Elgamal (default)\n"), 1 );
|
||||||
tty_printf( _(" (%d) DSA (sign only)\n"), 2 );
|
tty_printf( _(" (%d) DSA (sign only)\n"), 2 );
|
||||||
if( addmode )
|
if( addmode )
|
||||||
tty_printf( _(" (%d) ElGamal (encrypt only)\n"), 3 );
|
tty_printf( _(" (%d) Elgamal (encrypt only)\n"), 3 );
|
||||||
tty_printf( _(" (%d) RSA (sign only)\n"), 4 );
|
tty_printf( _(" (%d) RSA (sign only)\n"), 4 );
|
||||||
if (addmode)
|
if (addmode)
|
||||||
tty_printf( _(" (%d) RSA (encrypt only)\n"), 5 );
|
tty_printf( _(" (%d) RSA (encrypt only)\n"), 5 );
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* Handle a plaintext packet. If MFX is not NULL, update the MDs
|
* Handle a plaintext packet. If MFX is not NULL, update the MDs
|
||||||
* Note: we should use the filter stuff here, but we have to add some
|
* Note: we should use the filter stuff here, but we have to add some
|
||||||
@ -54,7 +53,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
|
|||||||
{
|
{
|
||||||
char *fname = NULL;
|
char *fname = NULL;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
off_t count=0;
|
static off_t count=0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int c;
|
int c;
|
||||||
int convert = pt->mode == 't';
|
int convert = pt->mode == 't';
|
||||||
@ -169,7 +168,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
|
|||||||
#endif
|
#endif
|
||||||
if( fp )
|
if( fp )
|
||||||
{
|
{
|
||||||
if(opt.max_output && (count++)>opt.max_output)
|
if(opt.max_output && (++count)>opt.max_output)
|
||||||
{
|
{
|
||||||
log_error("Error writing to `%s': %s\n",
|
log_error("Error writing to `%s': %s\n",
|
||||||
fname,"exceeded --max-output limit\n");
|
fname,"exceeded --max-output limit\n");
|
||||||
@ -235,7 +234,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
|
|||||||
#endif
|
#endif
|
||||||
if( fp )
|
if( fp )
|
||||||
{
|
{
|
||||||
if(opt.max_output && (count++)>opt.max_output)
|
if(opt.max_output && (++count)>opt.max_output)
|
||||||
{
|
{
|
||||||
log_error("Error writing to `%s': %s\n",
|
log_error("Error writing to `%s': %s\n",
|
||||||
fname,"exceeded --max-output limit\n");
|
fname,"exceeded --max-output limit\n");
|
||||||
@ -298,7 +297,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
|
|||||||
while( (c = iobuf_get(pt->buf)) != -1 ) {
|
while( (c = iobuf_get(pt->buf)) != -1 ) {
|
||||||
if( fp )
|
if( fp )
|
||||||
{
|
{
|
||||||
if(opt.max_output && (count++)>opt.max_output)
|
if(opt.max_output && (++count)>opt.max_output)
|
||||||
{
|
{
|
||||||
log_error("Error writing to `%s': %s\n",
|
log_error("Error writing to `%s': %s\n",
|
||||||
fname,"exceeded --max-output limit\n");
|
fname,"exceeded --max-output limit\n");
|
||||||
|
@ -144,7 +144,7 @@ do_check_messages( PKT_public_key *pk, PKT_signature *sig,
|
|||||||
*r_revoked = 0;
|
*r_revoked = 0;
|
||||||
if( pk->version == 4 && pk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
if( pk->version == 4 && pk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||||
log_info(_("key %08lX: this is a PGP generated "
|
log_info(_("key %08lX: this is a PGP generated "
|
||||||
"ElGamal key which is NOT secure for signatures!\n"),
|
"Elgamal key which is NOT secure for signatures!\n"),
|
||||||
(ulong)keyid_from_pk(pk,NULL));
|
(ulong)keyid_from_pk(pk,NULL));
|
||||||
return G10ERR_PUBKEY_ALGO;
|
return G10ERR_PUBKEY_ALGO;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list,
|
|||||||
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
||||||
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||||
log_info("this is a PGP generated "
|
log_info("this is a PGP generated "
|
||||||
"ElGamal key which is NOT secure for signatures!\n");
|
"Elgamal key which is NOT secure for signatures!\n");
|
||||||
free_secret_key( sk ); sk = NULL;
|
free_secret_key( sk ); sk = NULL;
|
||||||
}
|
}
|
||||||
else if( random_is_faked() && !is_insecure( sk ) ) {
|
else if( random_is_faked() && !is_insecure( sk ) ) {
|
||||||
@ -177,7 +177,7 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list,
|
|||||||
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
if( sk->version == 4 && (use & PUBKEY_USAGE_SIG)
|
||||||
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||||
log_info(_("skipped `%s': this is a PGP generated "
|
log_info(_("skipped `%s': this is a PGP generated "
|
||||||
"ElGamal key which is not secure for signatures!\n"),
|
"Elgamal key which is not secure for signatures!\n"),
|
||||||
locusr->d );
|
locusr->d );
|
||||||
free_secret_key( sk ); sk = NULL;
|
free_secret_key( sk ); sk = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user