summaryrefslogtreecommitdiff
path: root/lib/libskey
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-09-30 23:26:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-09-30 23:26:29 +0000
commit11840b37d664096fae0ce581dcde449e69f250fe (patch)
tree0aa368e2fa756749011d76c8b0dfbfdb824fc857 /lib/libskey
parent795936581b97df87578dcbb4f515c8dae37258b8 (diff)
Fix byte order problem with sha1.
Diffstat (limited to 'lib/libskey')
-rw-r--r--lib/libskey/skeysubr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c
index 1a30c98c75a..2f3825aa9e7 100644
--- a/lib/libskey/skeysubr.c
+++ b/lib/libskey/skeysubr.c
@@ -10,7 +10,7 @@
*
* S/KEY misc routines.
*
- * $Id: skeysubr.c,v 1.7 1996/09/30 18:55:56 millert Exp $
+ * $Id: skeysubr.c,v 1.8 1996/09/30 23:26:28 millert Exp $
*/
#include <stdio.h>
@@ -172,6 +172,9 @@ keycrunch_sha1(result, seed, passwd)
sha.digest[0] ^= sha.digest[4];
(void)memcpy((void *)result, (void *)sha.digest, 8);
+#if BYTE_ORDER == LITTLE_ENDIAN
+ sha1ByteReverse((u_int32_t *)result, 8);
+#endif /* LITTLE_ENDIAN */
return 0;
}
@@ -236,6 +239,9 @@ f_sha1(x)
sha.digest[0] ^= sha.digest[4];
(void)memcpy((void *)x, (void *)sha.digest, 8);
+#if BYTE_ORDER == LITTLE_ENDIAN
+ sha1ByteReverse((u_int32_t *)x, 8);
+#endif /* LITTLE_ENDIAN */
}
/* Strip trailing cr/lf from a line of text */