diff options
author | 2003-05-08 23:32:21 +0000 | |
---|---|---|
committer | 2003-05-08 23:32:21 +0000 | |
commit | 09fa52a74c174633f0dbdbf5b69a69bd8ed9a96f (patch) | |
tree | 9fff33eeb758b9f2d6e17de0e37b5eb5a8db38c5 | |
parent | Move setrgid(3) and setruid(3) from libc -> libcompat. (diff) | |
download | wireguard-openbsd-09fa52a74c174633f0dbdbf5b69a69bd8ed9a96f.tar.xz wireguard-openbsd-09fa52a74c174633f0dbdbf5b69a69bd8ed9a96f.zip |
Clear the digest local var w/ memset() in the End function.
-rw-r--r-- | lib/libc/hash/rmd160hl.c | 13 | ||||
-rw-r--r-- | lib/libc/hash/sha1hl.c | 13 | ||||
-rw-r--r-- | lib/libc/md/mdXhl.c | 13 |
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); } |