aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-04-06 11:07:09 +0000
committerWerner Koch <[email protected]>2015-04-06 11:07:09 +0000
commit4de8a58e44262a25564e2acef8c8865d1755982e (patch)
tree67709360f11d4c036a77462db7474258e9df18bd
parentgpg: Fix DoS while parsing mangled secret key packets. (diff)
downloadgnupg-4de8a58e44262a25564e2acef8c8865d1755982e.tar.gz
gnupg-4de8a58e44262a25564e2acef8c8865d1755982e.zip
gpg: Rename a debug macro.
* g10/options.h (DBG_CIPHER_VALUE): Rename to DBG_CRYPTO_VALUE. (DBG_CIPHER): Rename to DBG_CRYPTO.
-rw-r--r--g10/ecdh.c24
-rw-r--r--g10/encrypt.c4
-rw-r--r--g10/gpg.c4
-rw-r--r--g10/options.h4
-rw-r--r--g10/pkglue.c2
-rw-r--r--g10/pubkey-enc.c4
-rw-r--r--g10/seskey.c4
7 files changed, 23 insertions, 23 deletions
diff --git a/g10/ecdh.c b/g10/ecdh.c
index 07f398312..9576a1c1a 100644
--- a/g10/ecdh.c
+++ b/g10/ecdh.c
@@ -76,7 +76,7 @@ pk_ecdh_default_params (unsigned int qbits)
}
}
assert (i < DIM (kek_params_table));
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ECDH KEK params are", kek_params, sizeof(kek_params) );
return gcry_mpi_set_opaque (NULL, kek_params, 4 * 8);
@@ -138,7 +138,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
memmove (secret_x, secret_x+1, secret_x_size);
memset (secret_x+secret_x_size, 0, nbytes-secret_x_size);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ECDH shared secret X is:", secret_x, secret_x_size );
}
@@ -158,7 +158,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
kek_params = gcry_mpi_get_opaque (pkey[2], &nbits);
kek_params_size = (nbits+7)/8;
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh KDF params:", kek_params, kek_params_size);
/* Expect 4 bytes 03 01 hash_alg symm_alg. */
@@ -171,7 +171,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
kdf_hash_algo = kek_params[2];
kdf_encr_algo = kek_params[3];
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_debug ("ecdh KDF algorithms %s+%s with aeswrap\n",
openpgp_md_algo_name (kdf_hash_algo),
openpgp_cipher_algo_name (kdf_encr_algo));
@@ -215,7 +215,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
return err;
}
- if(DBG_CIPHER)
+ if(DBG_CRYPTO)
log_printhex ("ecdh KDF message params are:", message, message_size);
}
@@ -251,7 +251,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
/* We could have allocated more, so clean the tail before returning. */
memset (secret_x+secret_x_size, 0, old_size - secret_x_size);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh KEK is:", secret_x, secret_x_size );
}
@@ -317,7 +317,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
return err;
}
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh encrypting :", in, data_buf_size );
err = gcry_cipher_encrypt (hd, data_buf+1, data_buf_size+8,
@@ -333,7 +333,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
}
data_buf[0] = data_buf_size+8;
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh encrypted to:", data_buf+1, data_buf[0] );
result = gcry_mpi_set_opaque (NULL, data_buf, 8 * (1+data_buf[0]));
@@ -370,7 +370,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
in = data_buf+data_buf_size;
data_buf_size = data_buf[0];
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh decrypting :", data_buf+1, data_buf_size);
err = gcry_cipher_decrypt (hd, in, data_buf_size, data_buf+1,
@@ -386,7 +386,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi,
data_buf_size -= 8;
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("ecdh decrypted to :", in, data_buf_size);
/* Padding is removed later. */
@@ -420,12 +420,12 @@ gen_k (unsigned nbits)
gcry_mpi_t k;
k = gcry_mpi_snew (nbits);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_debug ("choosing a random k of %u bits\n", nbits);
gcry_mpi_randomize (k, nbits-1, GCRY_STRONG_RANDOM);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
{
unsigned char *buffer;
if (gcry_mpi_aprint (GCRYMPI_FMT_HEX, &buffer, NULL, k))
diff --git a/g10/encrypt.c b/g10/encrypt.c
index 7b5028d31..d5835d499 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -621,7 +621,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
}
make_session_key (cfx.dek);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("DEK is: ", cfx.dek->key, cfx.dek->keylen );
rc = write_pubkey_enc_from_list (pk_list, cfx.dek, out);
@@ -815,7 +815,7 @@ encrypt_filter (void *opaque, int control,
efx->cfx.dek->use_mdc = use_mdc (efx->pk_list,efx->cfx.dek->algo);
make_session_key ( efx->cfx.dek );
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("DEK is: ", efx->cfx.dek->key, efx->cfx.dek->keylen);
rc = write_pubkey_enc_from_list (efx->pk_list, efx->cfx.dek, a);
diff --git a/g10/gpg.c b/g10/gpg.c
index da4224fde..7df2d1de1 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1116,7 +1116,7 @@ set_debug (const char *level)
memory_stat_debug_mode = 1;
if (opt.debug & DBG_MPI_VALUE)
gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 2);
- if (opt.debug & DBG_CIPHER_VALUE )
+ if (opt.debug & DBG_CRYPTO_VALUE )
gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1);
if (opt.debug & DBG_IOBUF_VALUE )
iobuf_debug_mode = 1;
@@ -1126,7 +1126,7 @@ set_debug (const char *level)
log_info ("enabled debug flags:%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
(opt.debug & DBG_PACKET_VALUE )? " packet":"",
(opt.debug & DBG_MPI_VALUE )? " mpi":"",
- (opt.debug & DBG_CIPHER_VALUE )? " cipher":"",
+ (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"",
(opt.debug & DBG_FILTER_VALUE )? " filter":"",
(opt.debug & DBG_IOBUF_VALUE )? " iobuf":"",
(opt.debug & DBG_MEMORY_VALUE )? " memory":"",
diff --git a/g10/options.h b/g10/options.h
index 18cca2b83..217a960ee 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -268,7 +268,7 @@ struct {
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
#define DBG_MPI_VALUE 2 /* debug mpi details */
-#define DBG_CIPHER_VALUE 4 /* debug cipher handling */
+#define DBG_CRYPTO_VALUE 4 /* debug crypto handling */
/* (may reveal sensitive data) */
#define DBG_FILTER_VALUE 8 /* debug internal filter handling */
#define DBG_IOBUF_VALUE 16 /* debug iobuf stuff */
@@ -287,7 +287,7 @@ struct {
/* Tests for the debugging flags. */
#define DBG_PACKET (opt.debug & DBG_PACKET_VALUE)
-#define DBG_CIPHER (opt.debug & DBG_CIPHER_VALUE)
+#define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE)
#define DBG_FILTER (opt.debug & DBG_FILTER_VALUE)
#define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)
#define DBG_TRUST (opt.debug & DBG_TRUST_VALUE)
diff --git a/g10/pkglue.c b/g10/pkglue.c
index 684ce8a1d..d72275b81 100644
--- a/g10/pkglue.c
+++ b/g10/pkglue.c
@@ -263,7 +263,7 @@ pk_encrypt (pubkey_algo_t algo, gcry_mpi_t *resarr, gcry_mpi_t data,
public = get_mpi_from_sexp (s_ciph, "e", GCRYMPI_FMT_USG);
gcry_sexp_release (s_ciph);
s_ciph = NULL;
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
{
log_debug ("ECDH ephemeral key:");
gcry_mpi_dump (public);
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index 957476984..cb834afab 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -227,7 +227,7 @@ get_it (PKT_pubkey_enc *enc, DEK *dek, PKT_public_key *sk, u32 *keyid)
* DEK is the encryption key (session key) with length k
* CSUM
*/
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("DEK frame:", frame, nframe);
n = 0;
@@ -333,7 +333,7 @@ get_it (PKT_pubkey_enc *enc, DEK *dek, PKT_public_key *sk, u32 *keyid)
}
if (DBG_CLOCK)
log_clock ("decryption ready");
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_printhex ("DEK is:", dek->key, dek->keylen);
/* Check that the algo is in the preferences and whether it has expired. */
diff --git a/g10/seskey.c b/g10/seskey.c
index 410f0bfa6..e79faf8c9 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -82,7 +82,7 @@ encode_session_key (int openpgp_pk_algo, DEK *dek, unsigned int nbits)
u16 csum;
gcry_mpi_t a;
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_debug ("encode_session_key: encoding %d byte DEK", dek->keylen);
csum = 0;
@@ -116,7 +116,7 @@ encode_session_key (int openpgp_pk_algo, DEK *dek, unsigned int nbits)
memset (frame+n, i, i); /* Use it as the value of each padded byte. */
assert (n+i == nframe);
- if (DBG_CIPHER)
+ if (DBG_CRYPTO)
log_debug ("encode_session_key: "
"[%d] %02x %02x %02x ... %02x %02x %02x\n",
(int) nframe, frame[0], frame[1], frame[2],