|
|
6e4d5d |
diff -up libgcrypt-1.5.0/cipher/elgamal.c.leak libgcrypt-1.5.0/cipher/elgamal.c
|
|
|
6e4d5d |
--- libgcrypt-1.5.0/cipher/elgamal.c.leak 2011-02-04 20:09:38.000000000 +0100
|
|
|
6e4d5d |
+++ libgcrypt-1.5.0/cipher/elgamal.c 2012-12-03 14:51:10.743067964 +0100
|
|
|
6e4d5d |
@@ -641,7 +641,10 @@ elg_generate_ext (int algo, unsigned int
|
|
|
6e4d5d |
}
|
|
|
6e4d5d |
|
|
|
6e4d5d |
if (xvalue)
|
|
|
6e4d5d |
- ec = generate_using_x (&sk, nbits, xvalue, retfactors);
|
|
|
6e4d5d |
+ {
|
|
|
6e4d5d |
+ ec = generate_using_x (&sk, nbits, xvalue, retfactors);
|
|
|
6e4d5d |
+ gcry_mpi_release(xvalue);
|
|
|
6e4d5d |
+ }
|
|
|
6e4d5d |
else
|
|
|
6e4d5d |
{
|
|
|
6e4d5d |
generate (&sk, nbits, retfactors);
|
|
|
6e4d5d |
diff -up libgcrypt-1.5.0/cipher/primegen.c.leak libgcrypt-1.5.0/cipher/primegen.c
|
|
|
6e4d5d |
--- libgcrypt-1.5.0/cipher/primegen.c.leak 2012-04-05 15:37:52.000000000 +0200
|
|
|
6e4d5d |
+++ libgcrypt-1.5.0/cipher/primegen.c 2012-12-03 14:44:14.610010867 +0100
|
|
|
6e4d5d |
@@ -1198,10 +1198,7 @@ gcry_prime_group_generator (gcry_mpi_t *
|
|
|
6e4d5d |
gcry_mpi_t prime, gcry_mpi_t *factors,
|
|
|
6e4d5d |
gcry_mpi_t start_g)
|
|
|
6e4d5d |
{
|
|
|
6e4d5d |
- gcry_mpi_t tmp = gcry_mpi_new (0);
|
|
|
6e4d5d |
- gcry_mpi_t b = gcry_mpi_new (0);
|
|
|
6e4d5d |
- gcry_mpi_t pmin1 = gcry_mpi_new (0);
|
|
|
6e4d5d |
- gcry_mpi_t g = start_g? gcry_mpi_copy (start_g) : gcry_mpi_set_ui (NULL, 3);
|
|
|
6e4d5d |
+ gcry_mpi_t tmp, b, pmin1, g;
|
|
|
6e4d5d |
int first = 1;
|
|
|
6e4d5d |
int i, n;
|
|
|
6e4d5d |
|
|
|
6e4d5d |
@@ -1214,6 +1211,11 @@ gcry_prime_group_generator (gcry_mpi_t *
|
|
|
6e4d5d |
if (n < 2)
|
|
|
6e4d5d |
return gpg_error (GPG_ERR_INV_ARG);
|
|
|
6e4d5d |
|
|
|
6e4d5d |
+ tmp = gcry_mpi_new (0);
|
|
|
6e4d5d |
+ b = gcry_mpi_new (0);
|
|
|
6e4d5d |
+ pmin1 = gcry_mpi_new (0);
|
|
|
6e4d5d |
+ g = start_g? gcry_mpi_copy (start_g) : gcry_mpi_set_ui (NULL, 3);
|
|
|
6e4d5d |
+
|
|
|
6e4d5d |
/* Extra sanity check - usually disabled. */
|
|
|
6e4d5d |
/* mpi_set (tmp, factors[0]); */
|
|
|
6e4d5d |
/* for(i = 1; i < n; i++) */
|
|
|
6e4d5d |
diff -up libgcrypt-1.5.0/cipher/pubkey.c.leak libgcrypt-1.5.0/cipher/pubkey.c
|
|
|
6e4d5d |
--- libgcrypt-1.5.0/cipher/pubkey.c.leak 2011-06-13 12:23:50.000000000 +0200
|
|
|
6e4d5d |
+++ libgcrypt-1.5.0/cipher/pubkey.c 2012-12-03 15:23:42.377183489 +0100
|
|
|
6e4d5d |
@@ -2853,6 +2853,8 @@ gcry_pk_encrypt (gcry_sexp_t *r_ciph, gc
|
|
|
6e4d5d |
|
|
|
6e4d5d |
REGISTER_DEFAULT_PUBKEYS;
|
|
|
6e4d5d |
|
|
|
6e4d5d |
+ init_encoding_ctx (&ctx, PUBKEY_OP_ENCRYPT, gcry_pk_get_nbits (s_pkey));
|
|
|
6e4d5d |
+
|
|
|
6e4d5d |
/* Get the key. */
|
|
|
6e4d5d |
rc = sexp_to_key (s_pkey, 0, NULL, &pkey, &module);
|
|
|
6e4d5d |
if (rc)
|
|
|
6e4d5d |
@@ -2873,7 +2875,6 @@ gcry_pk_encrypt (gcry_sexp_t *r_ciph, gc
|
|
|
6e4d5d |
algo_elems = pubkey->elements_enc;
|
|
|
6e4d5d |
|
|
|
6e4d5d |
/* Get the stuff we want to encrypt. */
|
|
|
6e4d5d |
- init_encoding_ctx (&ctx, PUBKEY_OP_ENCRYPT, gcry_pk_get_nbits (s_pkey));
|
|
|
6e4d5d |
rc = sexp_data_to_mpi (s_data, &data, &ctx;;
|
|
|
6e4d5d |
if (rc)
|
|
|
6e4d5d |
goto leave;
|
|
|
6e4d5d |
diff -up libgcrypt-1.5.0/src/hmac256.c.leak libgcrypt-1.5.0/src/hmac256.c
|
|
|
6e4d5d |
--- libgcrypt-1.5.0/src/hmac256.c.leak 2011-02-04 20:17:33.000000000 +0100
|
|
|
6e4d5d |
+++ libgcrypt-1.5.0/src/hmac256.c 2012-12-03 15:37:36.504955809 +0100
|
|
|
6e4d5d |
@@ -435,7 +435,6 @@ _gcry_hmac256_finalize (hmac256_context_
|
|
|
6e4d5d |
tmphd = _gcry_hmac256_new (NULL, 0);
|
|
|
6e4d5d |
if (!tmphd)
|
|
|
6e4d5d |
{
|
|
|
6e4d5d |
- free (hd);
|
|
|
6e4d5d |
return NULL;
|
|
|
6e4d5d |
}
|
|
|
6e4d5d |
_gcry_hmac256_update (tmphd, hd->opad, 64);
|