summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/yarrow
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-12-05 23:16:28 +0000
committerEzra Peisach <epeisach@mit.edu>2001-12-05 23:16:28 +0000
commit3511d6915f2dab45f961ae616da4ad44405f8318 (patch)
tree13fc0c5700f445fed58613f442ba7e11b239c8da /src/lib/crypto/yarrow
parent3109dc13f177bf810224a45470fa4be9467e2e3f (diff)
downloadkrb5-3511d6915f2dab45f961ae616da4ad44405f8318.tar.gz
krb5-3511d6915f2dab45f961ae616da4ad44405f8318.tar.xz
krb5-3511d6915f2dab45f961ae616da4ad44405f8318.zip
* yarrow.c (krb5int_yarrow_stretch): Delare local variable unsigned.
(krb5int_yarrow_init): Zero cipher context on init. * yhash.h (HASH_Final): Use a variable other than out (shadow in yarrow.c) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14047 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/yarrow')
-rw-r--r--src/lib/crypto/yarrow/ChangeLog8
-rw-r--r--src/lib/crypto/yarrow/yarrow.c5
-rw-r--r--src/lib/crypto/yarrow/yhash.h10
3 files changed, 17 insertions, 6 deletions
diff --git a/src/lib/crypto/yarrow/ChangeLog b/src/lib/crypto/yarrow/ChangeLog
index d5f52f577..441e00466 100644
--- a/src/lib/crypto/yarrow/ChangeLog
+++ b/src/lib/crypto/yarrow/ChangeLog
@@ -1,3 +1,11 @@
+2001-12-05 Ezra Peisach <epeisach@mit.edu>
+
+ * yarrow.c (krb5int_yarrow_stretch): Delare local variable unsigned.
+ (krb5int_yarrow_init): Zero cipher context on init.
+
+ * yhash.h (HASH_Final): Use a variable other than out (shadow in
+ yarrow.c)
+
2001-11-21 Sam Hartman <hartmans@mit.edu>
* yarrow.c (Yarrow_detect_fork): Reseed the number generator including the fork rather than throwing away state.
diff --git a/src/lib/crypto/yarrow/yarrow.c b/src/lib/crypto/yarrow/yarrow.c
index b4e5a218e..aee91ab68 100644
--- a/src/lib/crypto/yarrow/yarrow.c
+++ b/src/lib/crypto/yarrow/yarrow.c
@@ -187,6 +187,8 @@ int krb5int_yarrow_init(Yarrow_CTX* y, const char *filename)
mem_zero(y->K, sizeof(y->K));
+ mem_zero(&y->cipher, sizeof(y->cipher));
+
TRY (krb5int_yarrow_cipher_init(&y->cipher, y->K));
y->out_left = 0;
y->out_count = 0;
@@ -757,7 +759,8 @@ int krb5int_yarrow_stretch(const byte* m, size_t size, byte* out, size_t out_siz
EXCEP_DECL;
const byte* s_i;
byte* outp;
- int left, use;
+ int left;
+ unsigned int use;
HASH_CTX hash, save;
byte digest[HASH_DIGEST_SIZE];
diff --git a/src/lib/crypto/yarrow/yhash.h b/src/lib/crypto/yarrow/yhash.h
index 24208a6b5..aaa739fe1 100644
--- a/src/lib/crypto/yarrow/yhash.h
+++ b/src/lib/crypto/yarrow/yhash.h
@@ -16,14 +16,14 @@
#define HASH_Update(x, buf, sz) shsUpdate(x, (const void*)buf, sz)
#define HASH_Final(x, tdigest) do { \
int loopvar; \
- unsigned char *out = (void *)(tdigest); \
+ unsigned char *out2 = (void *)(tdigest); \
HASH_CTX *ctx = (x); \
shsFinal(ctx); \
for (loopvar=0; loopvar<(sizeof(ctx->digest)/sizeof(ctx->digest[0])); loopvar++) { \
- out[loopvar*4] = (ctx->digest[loopvar]>>24)&0xff; \
- out[loopvar*4+1] = (ctx->digest[loopvar]>>16)&0xff; \
- out[loopvar*4+2] = (ctx->digest[loopvar]>>8)&0xff; \
- out[loopvar*4+3] = ctx->digest[loopvar]&0xff; \
+ out2[loopvar*4] = (ctx->digest[loopvar]>>24)&0xff; \
+ out2[loopvar*4+1] = (ctx->digest[loopvar]>>16)&0xff; \
+ out2[loopvar*4+2] = (ctx->digest[loopvar]>>8)&0xff; \
+ out2[loopvar*4+3] = ctx->digest[loopvar]&0xff; \
} \
} while(0)