summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/krb
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2010-01-08 02:12:24 +0000
committerEzra Peisach <epeisach@mit.edu>2010-01-08 02:12:24 +0000
commitf1ac7570002acc490b0f7a535435c1076779812c (patch)
tree1330622ed733fa38957a03c94f81b31a2c4eec8d /src/lib/crypto/krb
parentb10e3f1d00cf2a4e7f8e11180cba75e1ea49e362 (diff)
downloadkrb5-f1ac7570002acc490b0f7a535435c1076779812c.tar.gz
krb5-f1ac7570002acc490b0f7a535435c1076779812c.tar.xz
krb5-f1ac7570002acc490b0f7a535435c1076779812c.zip
yarrow code does not initialize keyblock enctype and uses unitialized value
The yarrow code uses a keyblock that is partially initialized. This results in krb5_k_free_key trying to look up the enctype to call the free handler. One of the valgrind reports: (there are several paths) ==26701== Conditional jump or move depends on uninitialised value(s) ==26701== at 0x40E9AF0: find_enctype (etypes.h:81) ==26701== by 0x40E9C9E: krb5_k_free_key (key.c:91) ==26701== by 0x40D641A: krb5int_yarrow_cipher_init (ycipher.c:49) ==26701== by 0x40D593A: yarrow_gate_locked (yarrow.c:578) ==26701== by 0x40D5349: krb5int_yarrow_output_Block (yarrow.c:423) ==26701== by 0x40D581B: yarrow_output_locked (yarrow.c:553) ==26701== by 0x40D5667: krb5int_yarrow_output (yarrow.c:513) ==26701== by 0x40EBD2D: krb5_c_random_make_octets (prng.c:112) ==26701== by 0x40D4119: krb5int_old_encrypt (old_aead.c:97) ==26701== by 0x40E9696: krb5_k_encrypt_iov (encrypt_iov.c:42) ==26701== by 0x8049554: main (t_encrypt.c:206) ==26701== ticket: 6625 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23609 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/krb')
-rw-r--r--src/lib/crypto/krb/yarrow/ycipher.c1
-rw-r--r--src/lib/crypto/krb/yarrow/ycipher.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/crypto/krb/yarrow/ycipher.c b/src/lib/crypto/krb/yarrow/ycipher.c
index 71b89b0fa..7222d94c5 100644
--- a/src/lib/crypto/krb/yarrow/ycipher.c
+++ b/src/lib/crypto/krb/yarrow/ycipher.c
@@ -50,6 +50,7 @@ krb5int_yarrow_cipher_init(CIPHER_CTX *ctx, unsigned const char * key)
ctx->key = NULL;
keyblock.contents = malloc(keylength);
keyblock.length = keylength;
+ keyblock.enctype = yarrow_enc_type;
if (keyblock.contents == NULL)
return (YARROW_NOMEM);
randombits.data = (char *) key;
diff --git a/src/lib/crypto/krb/yarrow/ycipher.h b/src/lib/crypto/krb/yarrow/ycipher.h
index 21151bd8c..4d7dc9dfd 100644
--- a/src/lib/crypto/krb/yarrow/ycipher.h
+++ b/src/lib/crypto/krb/yarrow/ycipher.h
@@ -18,6 +18,7 @@ typedef struct
*/
#define yarrow_enc_provider krb5int_enc_aes256
+#define yarrow_enc_type ENCTYPE_AES256_CTS_HMAC_SHA1_96
#define CIPHER_BLOCK_SIZE 16
#define CIPHER_KEY_SIZE 32