003 File Manager
Current Path:
/usr/src/tests/sys/geom/class/eli
usr
/
src
/
tests
/
sys
/
geom
/
class
/
eli
/
📁
..
📄
Makefile
(817 B)
📄
Makefile.depend
(317 B)
📄
attach_test.sh
(2.97 KB)
📄
conf.sh
(2.17 KB)
📄
configure_test.sh
(1.28 KB)
📄
delkey_test.sh
(3.03 KB)
📄
detach_test.sh
(1.03 KB)
📄
gentestvect.py
(1.58 KB)
📄
hmac_test.c
(706 B)
📄
init_test.sh
(10.91 KB)
📄
integrity_test.sh
(4.06 KB)
📄
kill_test.sh
(2.48 KB)
📄
misc_test.sh
(4.85 KB)
📄
onetime_test.sh
(4.07 KB)
📄
online_resize_test.sh
(8.73 KB)
📄
reentrancy_test.sh
(1.53 KB)
📄
resize_test.sh
(2.56 KB)
📄
setkey_test.sh
(4.6 KB)
📄
testvect.h
(471.52 KB)
Editing: hmac_test.c
/* * $FreeBSD$ */ #include <sys/param.h> #include <atf-c.h> #include <geom/eli/pkcs5v2.h> const struct { char *salt; size_t saltlen; char *passwd; int iterations; char *hmacout; size_t hmaclen; } testdata[] = { #include "testvect.h" }; ATF_TC_WITHOUT_HEAD(hmactest); ATF_TC_BODY(hmactest, tc) { size_t i; uint8_t hmacout[64]; for (i = 0; i < nitems(testdata); i++) { pkcs5v2_genkey(hmacout, testdata[i].hmaclen, (uint8_t *)testdata[i].salt, testdata[i].saltlen, testdata[i].passwd, testdata[i].iterations); ATF_REQUIRE(bcmp(hmacout, testdata[i].hmacout, testdata[i].hmaclen) == 0); } } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, hmactest); return (atf_no_error()); }
Upload File
Create Folder