Module Name: src
Committed By: christos
Date: Fri Jul 1 22:50:09 UTC 2016
Modified Files:
src/sbin/cgdconfig: Makefile pkcs5_pbkdf2.c
Log Message:
replace openssl HMAC(3) with our hmac(3).
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/cgdconfig/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sbin/cgdconfig/pkcs5_pbkdf2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/cgdconfig/Makefile
diff -u src/sbin/cgdconfig/Makefile:1.14 src/sbin/cgdconfig/Makefile:1.15
--- src/sbin/cgdconfig/Makefile:1.14 Tue Dec 14 12:46:21 2010
+++ src/sbin/cgdconfig/Makefile Fri Jul 1 18:50:09 2016
@@ -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 @@ CPPFLAGS+= -I${.CURDIR} -I. -DYY_NO_INPU
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>
Index: src/sbin/cgdconfig/pkcs5_pbkdf2.c
diff -u src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.15 src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.16
--- src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.15 Sat Nov 27 12:08:37 2010
+++ src/sbin/cgdconfig/pkcs5_pbkdf2.c Fri Jul 1 18:50:09 2016
@@ -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 @@ __RCSID("$NetBSD: pkcs5_pbkdf2.c,v 1.15
#include <err.h>
#include <util.h>
-#include <openssl/hmac.h>
-
#include "pkcs5_pbkdf2.h"
#include "utils.h"
@@ -76,9 +74,9 @@ prf_iterate(u_int8_t *r, const u_int8_t
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 @@ prf_iterate(u_int8_t *r, const u_int8_t
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);