summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/keyhash_provider/hmac_md5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/keyhash_provider/hmac_md5.c')
-rw-r--r--src/lib/crypto/keyhash_provider/hmac_md5.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/lib/crypto/keyhash_provider/hmac_md5.c b/src/lib/crypto/keyhash_provider/hmac_md5.c
index 53da03ad41..34ce67169e 100644
--- a/src/lib/crypto/keyhash_provider/hmac_md5.c
+++ b/src/lib/crypto/keyhash_provider/hmac_md5.c
@@ -1,7 +1,7 @@
/*
* lib/crypto/keyhash_provider/hmac_md5.c
*
- * Copyright 2001 by the Massachusetts Institute of Technology.
+ * Copyright 2001, 2009 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -65,10 +65,7 @@ k5_hmac_md5_hash (const krb5_keyblock *key, krb5_keyusage usage,
krb5_MD5Init (&ctx);
ms_usage = krb5int_arcfour_translate_usage (usage);
- t[0] = (ms_usage) & 0xff;
- t[1] = (ms_usage>>8) & 0xff;
- t[2] = (ms_usage >>16) & 0xff;
- t[3] = (ms_usage>>24) & 0XFF;
+ store_32_le(ms_usage, t);
krb5_MD5Update (&ctx, (unsigned char * ) &t, 4);
krb5_MD5Update (&ctx, (unsigned char *) input-> data,
(unsigned int) input->length );
@@ -116,10 +113,7 @@ k5_hmac_md5_hash_iov (const krb5_keyblock *key, krb5_keyusage usage,
krb5_MD5Init (&ctx);
ms_usage = krb5int_arcfour_translate_usage (usage);
- t[0] = (ms_usage) & 0xff;
- t[1] = (ms_usage>>8) & 0xff;
- t[2] = (ms_usage >>16) & 0xff;
- t[3] = (ms_usage>>24) & 0XFF;
+ store_32_le(ms_usage, t);
krb5_MD5Update (&ctx, (unsigned char * ) &t, 4);
for (i = 0; i < num_data; i++) {
const krb5_crypto_iov *iov = &data[i];
@@ -148,4 +142,3 @@ const struct krb5_keyhash_provider krb5int_keyhash_hmac_md5 = {
k5_hmac_md5_hash_iov,
NULL /*checksum again */
};
-