summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-05-08 23:32:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-05-08 23:32:22 +0000
commitf4422cb88e06037af23df8a38d63bac792607d6f (patch)
treed8121420eae405fb8c9a837bf1477b30c140aaa3 /lib
parent02199c1e86a3068fd2d60bd9e459a519c86fc504 (diff)
Clear the digest local var w/ memset() in the End function.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/hash/rmd160hl.c13
-rw-r--r--lib/libc/hash/sha1hl.c13
-rw-r--r--lib/libc/md/mdXhl.c13
3 files changed, 21 insertions, 18 deletions
diff --git a/lib/libc/hash/rmd160hl.c b/lib/libc/hash/rmd160hl.c
index bf0060029be..9d61fc6f968 100644
--- a/lib/libc/hash/rmd160hl.c
+++ b/lib/libc/hash/rmd160hl.c
@@ -8,17 +8,17 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: rmd160hl.c,v 1.3 2002/12/23 04:33:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: rmd160hl.c,v 1.4 2003/05/08 23:32:21 millert Exp $";
#endif /* LIBC_SCCS and not lint */
-#include <stdlib.h>
-#include <stdio.h>
+#include <sys/types.h>
+
#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
#include <rmd160.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
/* ARGSUSED */
char *
@@ -37,6 +37,7 @@ RMD160End(RMD160_CTX *ctx, char *buf)
buf[i + i + 1] = hex[digest[i] & 0x0f];
}
buf[i + i] = '\0';
+ memset(digest, 0, sizeof(digest));
return(buf);
}
diff --git a/lib/libc/hash/sha1hl.c b/lib/libc/hash/sha1hl.c
index a8f3a732ca1..5ffaf9735d1 100644
--- a/lib/libc/hash/sha1hl.c
+++ b/lib/libc/hash/sha1hl.c
@@ -8,17 +8,17 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sha1hl.c,v 1.3 2002/12/23 04:33:31 millert Exp $";
+static const char rcsid[] = "$OpenBSD: sha1hl.c,v 1.4 2003/05/08 23:32:21 millert Exp $";
#endif /* LIBC_SCCS and not lint */
-#include <stdlib.h>
-#include <stdio.h>
+#include <sys/types.h>
+
#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
#include <sha1.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
/* ARGSUSED */
char *
@@ -37,6 +37,7 @@ SHA1End(SHA1_CTX *ctx, char *buf)
buf[i + i + 1] = hex[digest[i] & 0x0f];
}
buf[i + i] = '\0';
+ memset(digest, 0, sizeof(digest));
return(buf);
}
diff --git a/lib/libc/md/mdXhl.c b/lib/libc/md/mdXhl.c
index ae2f7fe9441..5b9dae7713e 100644
--- a/lib/libc/md/mdXhl.c
+++ b/lib/libc/md/mdXhl.c
@@ -8,17 +8,17 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: mdXhl.c,v 1.10 2002/12/23 04:33:31 millert Exp $";
+static const char rcsid[] = "$OpenBSD: mdXhl.c,v 1.11 2003/05/08 23:32:21 millert Exp $";
#endif /* LIBC_SCCS and not lint */
-#include <stdlib.h>
-#include <stdio.h>
+#include <sys/types.h>
+
#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
#include <mdX.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
/* ARGSUSED */
char *
@@ -36,6 +36,7 @@ MDXEnd(MDX_CTX *ctx, char *buf)
buf[i+i+1] = hex[digest[i] & 0x0f];
}
buf[i+i] = '\0';
+ memset(digest, 0, sizeof(digest));
return(buf);
}