Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/cgdconfig replace openssl HMAC(3) with our hmac(3).
details: https://anonhg.NetBSD.org/src/rev/dbaf75acc92f
branches: trunk
changeset: 346222:dbaf75acc92f
user: christos <christos%NetBSD.org@localhost>
date: Fri Jul 01 22:50:09 2016 +0000
description:
replace openssl HMAC(3) with our hmac(3).
diffstat:
sbin/cgdconfig/Makefile | 6 +++---
sbin/cgdconfig/pkcs5_pbkdf2.c | 12 +++++-------
2 files changed, 8 insertions(+), 10 deletions(-)
diffs (67 lines):
diff -r 70709da0796b -r dbaf75acc92f sbin/cgdconfig/Makefile
--- a/sbin/cgdconfig/Makefile Fri Jul 01 22:46:20 2016 +0000
+++ b/sbin/cgdconfig/Makefile Fri Jul 01 22:50:09 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2010/12/14 17:46:21 pooka Exp $
+# $NetBSD: Makefile,v 1.15 2016/07/01 22:50:09 christos Exp $
RUMPPRG=cgdconfig
MAN= cgdconfig.8
@@ -14,7 +14,7 @@
YHEADER=1
-DPADD= ${LIBUTIL} ${LIBCRYPTO} ${LIBCRYPT} ${LIBY} ${LIBL}
-LDADD= -lutil -lcrypto -lcrypt -ly -ll
+DPADD= ${LIBUTIL} ${LIBCRYPT} ${LIBY} ${LIBL}
+LDADD= -lutil -lcrypt -ly -ll
.include <bsd.prog.mk>
diff -r 70709da0796b -r dbaf75acc92f sbin/cgdconfig/pkcs5_pbkdf2.c
--- a/sbin/cgdconfig/pkcs5_pbkdf2.c Fri Jul 01 22:46:20 2016 +0000
+++ b/sbin/cgdconfig/pkcs5_pbkdf2.c Fri Jul 01 22:50:09 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pkcs5_pbkdf2.c,v 1.15 2010/11/27 17:08:37 elric Exp $ */
+/* $NetBSD: pkcs5_pbkdf2.c,v 1.16 2016/07/01 22:50:09 christos Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: pkcs5_pbkdf2.c,v 1.15 2010/11/27 17:08:37 elric Exp $");
+__RCSID("$NetBSD: pkcs5_pbkdf2.c,v 1.16 2016/07/01 22:50:09 christos Exp $");
#endif
#include <sys/resource.h>
@@ -58,8 +58,6 @@
#include <err.h>
#include <util.h>
-#include <openssl/hmac.h>
-
#include "pkcs5_pbkdf2.h"
#include "utils.h"
@@ -76,9 +74,9 @@
int first_time = 1;
size_t i;
size_t datalen;
- unsigned int tmplen;
+ ssize_t tmplen;
u_int8_t *data;
- u_int8_t tmp[EVP_MAX_MD_SIZE];
+ u_int8_t tmp[128];
data = emalloc(Slen + 4);
(void)memcpy(data, S, Slen);
@@ -86,7 +84,7 @@
datalen = Slen + 4;
for (i=0; i < c; i++) {
- (void)HMAC(EVP_sha1(), P, Plen, data, datalen, tmp, &tmplen);
+ tmplen = hmac("sha1", P, Plen, data, datalen, tmp, sizeof(tmp));
assert(tmplen == PRF_BLOCKLEN);
Home |
Main Index |
Thread Index |
Old Index