diff options
author | Robert Mustacchi <rm@joyent.com> | 2018-09-06 18:12:13 +0000 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2019-09-19 20:57:54 -0400 |
commit | e75b2cb046700ccab0100afdcd81f2b860fcca87 (patch) | |
tree | 95c43824a9d8277729896a713bce817607db39a4 | |
parent | 080a98956c44d42821b98e1d0f2ce825925e38db (diff) | |
download | illumos-joyent-e75b2cb046700ccab0100afdcd81f2b860fcca87.tar.gz |
11706 crypto tests need to run 32-bit and 64-bit
Portions contributed by: Jason King <jason.king@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
14 files changed, 282 insertions, 103 deletions
diff --git a/usr/src/pkg/manifests/system-test-cryptotest.mf b/usr/src/pkg/manifests/system-test-cryptotest.mf index d480522d8b..9b4d8153b9 100644 --- a/usr/src/pkg/manifests/system-test-cryptotest.mf +++ b/usr/src/pkg/manifests/system-test-cryptotest.mf @@ -13,7 +13,7 @@ # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. -# Copyright 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # set name=pkg.fmri value=pkg:/system/test/cryptotest@$(PKGVERS) @@ -26,38 +26,146 @@ dir path=opt/crypto-tests dir path=opt/crypto-tests/bin dir path=opt/crypto-tests/runfiles dir path=opt/crypto-tests/tests +dir path=opt/crypto-tests/tests/aes group=root mode=0755 owner=root +dir path=opt/crypto-tests/tests/aes/kcf group=root mode=0755 owner=root +dir path=opt/crypto-tests/tests/aes/pkcs group=root mode=0755 owner=root dir path=opt/crypto-tests/tests/digest dir path=opt/crypto-tests/tests/digest/kcf dir path=opt/crypto-tests/tests/digest/pkcs -dir path=opt/crypto-tests/tests/kcf -dir path=opt/crypto-tests/tests/kcf/aes -dir path=opt/crypto-tests/tests/pkcs -dir path=opt/crypto-tests/tests/pkcs/aes file path=opt/crypto-tests/README mode=0444 file path=opt/crypto-tests/bin/cryptotest mode=0555 file path=opt/crypto-tests/runfiles/default.run mode=0444 -file path=opt/crypto-tests/tests/digest/kcf/sha1 mode=0555 -file path=opt/crypto-tests/tests/digest/kcf/sha256 mode=0555 -file path=opt/crypto-tests/tests/digest/kcf/sha384 mode=0555 -file path=opt/crypto-tests/tests/digest/kcf/sha512 mode=0555 -file path=opt/crypto-tests/tests/digest/pkcs/sha1 mode=0555 -file path=opt/crypto-tests/tests/digest/pkcs/sha256 mode=0555 -file path=opt/crypto-tests/tests/digest/pkcs/sha384 mode=0555 -file path=opt/crypto-tests/tests/digest/pkcs/sha512 mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_cbc mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_ccm mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_cmac mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_ctr mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_ecb mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/aes_gcm mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/cleanup mode=0555 -file path=opt/crypto-tests/tests/kcf/aes/setup mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_cbc mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_ccm mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_cmac mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_ctr mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_ecb mode=0555 -file path=opt/crypto-tests/tests/pkcs/aes/aes_gcm mode=0555 +file opt/crypto-tests/tests/aes/kcf/aes_cbc_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_cbc_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_cbc_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_cbc_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ccm_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ccm_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ccm_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ccm_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_cmac_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_cmac_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_cmac_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_cmac_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ctr_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ctr_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ctr_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ctr_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ecb_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ecb_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_ecb_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_ecb_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_gcm_32 \ + path=opt/crypto-tests/tests/aes/kcf/aes_gcm_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/aes_gcm_64 \ + path=opt/crypto-tests/tests/aes/kcf/aes_gcm_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/cleanup \ + path=opt/crypto-tests/tests/aes/kcf/cleanup group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/kcf/setup \ + path=opt/crypto-tests/tests/aes/kcf/setup group=root mode=0555 owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_cbc_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_cbc_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_cbc_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_cbc_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ccm_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ccm_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ccm_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ccm_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_cmac_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_cmac_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_cmac_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_cmac_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ctr_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ctr_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ctr_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ctr_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ecb_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ecb_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_ecb_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_ecb_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_gcm_32 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_gcm_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/aes/pkcs/aes_gcm_64 \ + path=opt/crypto-tests/tests/aes/pkcs/aes_gcm_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/cleanup \ + path=opt/crypto-tests/tests/digest/kcf/cleanup group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/setup \ + path=opt/crypto-tests/tests/digest/kcf/setup group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha1_32 \ + path=opt/crypto-tests/tests/digest/kcf/sha1_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha1_64 \ + path=opt/crypto-tests/tests/digest/kcf/sha1_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha256_32 \ + path=opt/crypto-tests/tests/digest/kcf/sha256_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha256_64 \ + path=opt/crypto-tests/tests/digest/kcf/sha256_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha384_32 \ + path=opt/crypto-tests/tests/digest/kcf/sha384_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha384_64 \ + path=opt/crypto-tests/tests/digest/kcf/sha384_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha512_32 \ + path=opt/crypto-tests/tests/digest/kcf/sha512_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/kcf/sha512_64 \ + path=opt/crypto-tests/tests/digest/kcf/sha512_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha1_32 \ + path=opt/crypto-tests/tests/digest/pkcs/sha1_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha1_64 \ + path=opt/crypto-tests/tests/digest/pkcs/sha1_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha256_32 \ + path=opt/crypto-tests/tests/digest/pkcs/sha256_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha256_64 \ + path=opt/crypto-tests/tests/digest/pkcs/sha256_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha384_32 \ + path=opt/crypto-tests/tests/digest/pkcs/sha384_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha384_64 \ + path=opt/crypto-tests/tests/digest/pkcs/sha384_64 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha512_32 \ + path=opt/crypto-tests/tests/digest/pkcs/sha512_32 group=root mode=0555 \ + owner=root +file opt/crypto-tests/tests/digest/pkcs/sha512_64 \ + path=opt/crypto-tests/tests/digest/pkcs/sha512_64 group=root mode=0555 \ + owner=root license cr_Sun license=cr_Sun license lic_CDDL license=lic_CDDL depend fmri=driver/crypto/dprov type=require diff --git a/usr/src/test/crypto-tests/cmd/kcf/Makefile b/usr/src/test/crypto-tests/cmd/kcf/Makefile index fd2d8f2746..3964744d24 100644 --- a/usr/src/test/crypto-tests/cmd/kcf/Makefile +++ b/usr/src/test/crypto-tests/cmd/kcf/Makefile @@ -12,27 +12,32 @@ # # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2018, Joyent, Inc. # include $(SRC)/Makefile.master include $(SRC)/test/Makefile.com ROOTOPTPKG = $(ROOT)/opt/crypto-tests -ROOTBIN = $(ROOTOPTPKG)/tests/kcf/aes +ROOTAES = $(ROOTOPTPKG)/tests/aes/kcf +ROOTDIGEST = $(ROOTOPTPKG)/tests/digest/kcf +ROOTDIRS = $(ROOTAES) $(ROOTDIGEST) PROGS = cleanup setup -CMDS = $(PROGS:%=$(ROOTBIN)/%) +CMDS = $(PROGS:%=$(ROOTAES)/%) $(PROGS:%=$(ROOTDIGEST)/%) $(CMDS) := FILEMODE = 0555 all lint clean clobber: install: $(CMDS) -$(CMDS): $(ROOTBIN) +$(CMDS): $(ROOTDIRS) -$(ROOTBIN): +$(ROOTDIRS): $(INS.dir) -$(ROOTBIN)/%: %.ksh +$(ROOTAES)/%: %.ksh + $(INS.rename) +$(ROOTDIGEST)/%: %.ksh $(INS.rename) diff --git a/usr/src/test/crypto-tests/runfiles/default.run b/usr/src/test/crypto-tests/runfiles/default.run index 67f3d198a2..bb80a8d374 100644 --- a/usr/src/test/crypto-tests/runfiles/default.run +++ b/usr/src/test/crypto-tests/runfiles/default.run @@ -23,20 +23,28 @@ timeout = 60 post = outputdir = /var/tmp/test_results -[/opt/crypto-tests/tests/pkcs/aes] -tests = ['aes_cbc', 'aes_ccm', 'aes_cmac', 'aes_ctr', 'aes_ecb', 'aes_gcm'] +[/opt/crypto-tests/tests/aes/pkcs] +tests = ['aes_cbc_32', 'aes_ccm_32', 'aes_cmac_32', + 'aes_ctr_32', 'aes_ecb_32', 'aes_gcm_32', + 'aes_cbc_64', 'aes_ccm_64', 'aes_cmac_64', + 'aes_ctr_64', 'aes_ecb_64', 'aes_gcm_64'] -[/opt/crypto-tests/tests/kcf/aes] +[/opt/crypto-tests/tests/aes/kcf] pre = setup user = root -tests = ['aes_cbc', 'aes_ccm', 'aes_cmac', 'aes_ctr', 'aes_ecb', 'aes_gcm'] +tests = ['aes_cbc_32', 'aes_ccm_32', 'aes_cmac_32', + 'aes_ctr_32', 'aes_ecb_32', 'aes_gcm_32', + 'aes_cbc_64', 'aes_ccm_64', 'aes_cmac_64', + 'aes_ctr_64', 'aes_ecb_64', 'aes_gcm_64'] post = cleanup [/opt/crypto-tests/tests/digest/pkcs] -tests = ['sha1', 'sha256', 'sha384', 'sha512'] +tests = ['sha1_32', 'sha256_32', 'sha384_32', 'sha512_32', + 'sha1_64', 'sha256_64', 'sha384_64', 'sha512_64' ] [/opt/crypto-tests/tests/digest/kcf] pre = setup user = root -tests = ['sha1', 'sha256', 'sha384', 'sha512'] +tests = ['sha1_32', 'sha256_32', 'sha384_32', 'sha512_32', + 'sha1_64', 'sha256_64', 'sha384_64', 'sha512_64' ] post = cleanup diff --git a/usr/src/test/crypto-tests/tests/common/Makefile b/usr/src/test/crypto-tests/tests/common/Makefile index a8d92a7bef..c1c9cfcf50 100644 --- a/usr/src/test/crypto-tests/tests/common/Makefile +++ b/usr/src/test/crypto-tests/tests/common/Makefile @@ -12,25 +12,28 @@ # # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. -# Copyright (c) 2019, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # include $(SRC)/cmd/Makefile.cmd include $(SRC)/cmd/Makefile.ctf include $(SRC)/test/Makefile.com -OBJS = testfuncs.o cryptotest_pkcs.o cryptotest_kcf.o +BASEOBJS = testfuncs.o cryptotest_pkcs.o cryptotest_kcf.o +OBJS = $(BASEOBJS:%.o=%.32.o) $(BASEOBJS:%.o=%.64.o) SRCS = $(OBJS:%.o=%.c) CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I$(SRC)/common/crypto/ all install: $(OBJS) -%.o: %.c +%.32.o: %.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -lint: +%.64.o: %.c + $(COMPILE64.c) -o $@ $< + $(POST_PROCESS_O) clobber clean: -$(RM) $(OBJS) diff --git a/usr/src/test/crypto-tests/tests/common/cryptotest.h b/usr/src/test/crypto-tests/tests/common/cryptotest.h index ac3d18bc7b..e48ddced01 100644 --- a/usr/src/test/crypto-tests/tests/common/cryptotest.h +++ b/usr/src/test/crypto-tests/tests/common/cryptotest.h @@ -49,7 +49,7 @@ typedef struct test_fg { testfunc_t update; } test_fg_t; -#define CRYPTO_INVALID_SESSION ((size_t)-1) +#define CRYPTO_INVALID_SESSION ((crypto_session_id_t)-1) typedef struct crypto_op crypto_op_t; int run_test(cryptotest_t *args, uint8_t *cmp, size_t cmplen, test_fg_t *funcs); diff --git a/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c b/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c index 780dc37d80..eed7454382 100644 --- a/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c +++ b/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c @@ -49,7 +49,7 @@ cryptotest_error(char *name, CK_RV rv) } crypto_op_t * -cryptotest_init(cryptotest_t *arg, size_t fg) +cryptotest_init(cryptotest_t *arg, crypto_func_group_t fg) { crypto_op_t *op = malloc(sizeof (*op)); diff --git a/usr/src/test/crypto-tests/tests/digest/Makefile b/usr/src/test/crypto-tests/tests/digest/Makefile index aa0aeb682e..af5392b037 100644 --- a/usr/src/test/crypto-tests/tests/digest/Makefile +++ b/usr/src/test/crypto-tests/tests/digest/Makefile @@ -20,9 +20,15 @@ include $(SRC)/cmd/Makefile.ctf ALGS = sha1 sha256 sha384 sha512 CRYPTO = pkcs kcf -PROGS_pkcs = $(ALGS:%=%_pkcs) -PROGS_kcf = $(ALGS:%=%_kcf) -PROGS = $(PROGS_pkcs) $(PROGS_kcf) +PROGS_pkcs_32 = $(ALGS:%=%_32_pkcs) +PROGS_pkcs_64 = $(ALGS:%=%_64_pkcs) +PROGS_kcf_32 = $(ALGS:%=%_32_kcf) +PROGS_kcf_64 = $(ALGS:%=%_64_kcf) +PROGS_pkcs = $(PROGS_pkcs_32) $(PROGS_pkcs_64) +PROGS_kcf = $(PROGS_kcf_32) $(PROGS_kcf_64) +PROGS_32 = $(PROGS_pkcs_32) $(PROGS_kcf_32) +PROGS_64 = $(PROGS_pkcs_64) $(PROGS_kcf_64) +PROGS = $(PROGS_32) $(PROGS_64) ROOTOPTPKG = $(ROOT)/opt/crypto-tests TESTROOT = $(ROOTOPTPKG)/tests/digest @@ -31,15 +37,22 @@ TESTDIR_kcf = $(TESTROOT)/kcf COMMONDIR = ../common -$(CRYPTO:%=sha1_%) := OBJS = sha1.o -$(CRYPTO:%=sha256_%) := OBJS = sha256.o -$(CRYPTO:%=sha384_%) := OBJS = sha384.o -$(CRYPTO:%=sha512_%) := OBJS = sha512.o +$(CRYPTO:%=sha1_32_%) := OBJS = sha1.32.o +$(CRYPTO:%=sha256_32_%) := OBJS = sha256.32.o +$(CRYPTO:%=sha384_32_%) := OBJS = sha384.32.o +$(CRYPTO:%=sha512_32_%) := OBJS = sha512.32.o -OBJS_COMMON = $(COMMONDIR)/testfuncs.o -$(PROGS_pkcs) := OBJS_COMMON += $(COMMONDIR)/cryptotest_pkcs.o -$(PROGS_kcf) := OBJS_COMMON += $(COMMONDIR)/cryptotest_kcf.o -$(PROGS) := OBJS += main.o +$(CRYPTO:%=sha1_64_%) := OBJS = sha1.64.o +$(CRYPTO:%=sha256_64_%) := OBJS = sha256.64.o +$(CRYPTO:%=sha384_64_%) := OBJS = sha384.64.o +$(CRYPTO:%=sha512_64_%) := OBJS = sha512.64.o + +$(PROGS_32) := OBJS_COMMON = main.32.o $(COMMONDIR)/testfuncs.32.o +$(PROGS_64) := OBJS_COMMON = main.64.o $(COMMONDIR)/testfuncs.64.o +$(PROGS_pkcs_32) := OBJS_COMMON += $(COMMONDIR)/cryptotest_pkcs.32.o +$(PROGS_pkcs_64) := OBJS_COMMON += $(COMMONDIR)/cryptotest_pkcs.64.o +$(PROGS_kcf_32) := OBJS_COMMON += $(COMMONDIR)/cryptotest_kcf.32.o +$(PROGS_kcf_64) := OBJS_COMMON += $(COMMONDIR)/cryptotest_kcf.64.o CSTD = $(CSTD_GNU99) @@ -51,29 +64,41 @@ LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 $(PROGS_pkcs) := LDLIBS += -lpkcs11 -lcryptoutil -CMDS_pkcs = $(ALGS:%=$(TESTDIR_pkcs)/%) -CMDS_kcf = $(ALGS:%=$(TESTDIR_kcf)/%) +CMDS_pkcs = $(PROGS_pkcs:%_pkcs=$(TESTDIR_pkcs)/%) +CMDS_kcf = $(PROGS_kcf:%_kcf=$(TESTDIR_kcf)/%) CMDS = $(CMDS_pkcs) $(CMDS_kcf) $(CMDS) := FILEMODE = 0555 all: $(PROGS) -$(COMMONDIR)/%.o: -$(PROGS): main.o +$(PROGS): main.32.o main.64.o -%_pkcs: %.o +%_32_pkcs: %.32.o $(LINK.c) -o $@ $(OBJS) $(OBJS_COMMON) $(LDLIBS) $(POST_PROCESS) -%_kcf: %.o +%_64_pkcs: %.64.o + $(LINK64.c) -o $@ $(OBJS) $(OBJS_COMMON) $(LDLIBS) + $(POST_PROCESS) + +%_32_kcf: %.32.o $(LINK.c) -o $@ $(OBJS) $(OBJS_COMMON) $(LDLIBS) $(POST_PROCESS) -%.o: %.c +%_64_kcf: %.64.o + $(LINK64.c) -o $@ $(OBJS) $(OBJS_COMMON) $(LDLIBS) + $(POST_PROCESS) + +%.32.o: %.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) +%.64.o: %.c + $(COMPILE64.c) -o $@ $< + $(POST_PROCESS_O) + + install: all $(CMDS) lint: $(CRYPTO:%=lint_%) @@ -90,16 +115,21 @@ clobber: clean -$(RM) $(PROGS) clean: - -$(RM) $(ALGS:%=%.o) main.o + -$(RM) $(ALGS:%=%.32.o) $(ALGS:%=%.64.o) main.32.o main.64.o $(CMDS): $(TESTDIR_pkcs) $(TESTDIR_kcf) $(PROGS) $(TESTDIR_pkcs) $(TESTDIR_kcf): $(INS.dir) - @echo Cmds: $(CMDS) -$(TESTROOT)/pkcs/%: %_pkcs +$(TESTDIR_pkcs)/%_32: %_32_pkcs + $(INS.rename) + +$(TESTDIR_pkcs)/%_64: %_64_pkcs + $(INS.rename) + +$(TESTDIR_kcf)/%_32: %_32_kcf $(INS.rename) -$(TESTROOT)/kcf/%: %_kcf +$(TESTDIR_kcf)/%_64: %_64_kcf $(INS.rename) diff --git a/usr/src/test/crypto-tests/tests/modes/aes/Makefile.subdirs b/usr/src/test/crypto-tests/tests/modes/aes/Makefile.subdirs index f4b8d27bbe..6544b885e6 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/Makefile.subdirs +++ b/usr/src/test/crypto-tests/tests/modes/aes/Makefile.subdirs @@ -12,72 +12,97 @@ # # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2018, Joyent, Inc. # +include $(SRC)/cmd/Makefile.cmd include $(SRC)/test/Makefile.com +include $(SRC)/cmd/Makefile.ctf CRYPTO = pkcs kcf -PROGS = $(CRYPTO:%=$(PROG)_%) +PROGS_32 = $(CRYPTO:%=$(BASEPROG)_32_%) +PROGS_64 = $(CRYPTO:%=$(BASEPROG)_64_%) +PROGS = $(PROGS_32) $(PROGS_64) +PROGS_pkcs = $(BASEPROG:%=%_32_pkcs) $(BASEPROG:%=%_64_pkcs) +PROGS_kcf = $(BASEPROG:%=%_32_kcf) $(BASEPROG:%=%_64_kcf) + ROOTOPTPKG = $(ROOT)/opt/crypto-tests -TESTROOT = $(ROOTOPTPKG)/tests/#$(SUFFIX)/aes -TESTDIR = $(CRYPTO:%=$(TESTROOT)/%/aes) +TESTROOT = $(ROOTOPTPKG)/tests/aes +TESTDIR_pkcs = $(TESTROOT)/pkcs +TESTDIR_kcf = $(TESTROOT)/kcf COMMONDIR = ../../../common -OBJS_COMMON = testfuncs.o -OBJS_COMDIR = $(OBJS_COMMON:%=$(COMMONDIR)/%) -OBJS_LOCAL = $(PROG:%=%.o) -OBJS = $(OBJS_LOCAL) $(OBJS_COMDIR) -OBJS_PKCS = $(OBJS_LOCAL) $(OBJS_COMDIR) $(COMMONDIR)/cryptotest_pkcs.o -OBJS_KCF = $(OBJS_LOCAL) $(OBJS_COMDIR) $(COMMONDIR)/cryptotest_kcf.o -SRCS = $(OBJS:%.o=%.c) -PKCSLIBS = -lpkcs11 -lcryptoutil +$(PROGS_32) := OBJS += $(COMMONDIR)/testfuncs.32.o +$(PROGS_64) := OBJS += $(COMMONDIR)/testfuncs.64.o +$(PROGS_32) := OBJS += $(BASEPROG:%=%.32.o) +$(PROGS_64) := OBJS += $(BASEPROG:%=%.64.o) +$(BASEPROG)_32_pkcs := OBJS += $(COMMONDIR)/cryptotest_pkcs.32.o +$(BASEPROG)_64_pkcs := OBJS += $(COMMONDIR)/cryptotest_pkcs.64.o +$(BASEPROG)_32_kcf := OBJS += $(COMMONDIR)/cryptotest_kcf.32.o +$(BASEPROG)_64_kcf := OBJS += $(COMMONDIR)/cryptotest_kcf.64.o + +$(PROGS_pkcs) := LDLIBS += -lpkcs11 -lcryptoutil CSTD = $(CSTD_GNU99) -CMDS = $(TESTDIR:%=%/$(PROG)) -$(CMDS) := FILEMODE = 0555 +CMDS_pkcs = $(PROGS_pkcs:%_pkcs=$(TESTDIR_pkcs)/%) +CMDS_kcf = $(PROGS_kcf:%_kcf=$(TESTDIR_kcf)/%) +CMDS = $(CMDS_pkcs) $(CMDS_kcf) -LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2 -LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 +$(CMDS) := FILEMODE = 0555 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 CPPFLAGS += -I$(COMMONDIR) -I$(SRC)/common/crypto/ all: $(PROGS) -$(PROG)_kcf: $(OBJS_KCF) - $(LINK.c) $(OBJS_KCF) -o $@ $(LDLIBS) +%_32_pkcs: %.32.o + $(LINK.c) $(OBJS) -o $@ $(LDLIBS) $(POST_PROCESS) -$(PROG)_pkcs: $(OBJS_PKCS) - $(LINK.c) $(OBJS_PKCS) -o $@ $(LDLIBS) $(PKCSLIBS) +%_64_pkcs: %.64.o + $(LINK64.c) $(OBJS) -o $@ $(LDLIBS) $(POST_PROCESS) +%_32_kcf: %.32.o + $(LINK.c) $(OBJS) -o $@ $(LDLIBS) + $(POST_PROCESS) -$(COMMONDIR)/%.o: +%_64_kcf: %.64.o + $(LINK64.c) $(OBJS) -o $@ $(LDLIBS) + $(POST_PROCESS) -%.o: %.c +%.32.o: %.c $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) -install: all $(CMDS) +%.64.o: %.c + $(COMPILE64.c) -o $@ $< + $(POST_PROCESS_O) -lint: $(CRYPTO:%=lint_%) + echo $(CMDS_kcf) -lint_pkcs: - $(LINT.c) $(OBJS_PKCS:%.o=%.c) $(LDLIBS) $(PKCSLIBS) +install: all $(CMDS) -lint_kcf: - $(LINT.c) $(OBJS_KCF:%.o=%.c) $(LDLIBS) clobber: clean -$(RM) $(PROGS) clean: - -$(RM) $(OBJS_LOCAL) + -$(RM) *.o -$(CMDS): $(TESTDIR) $(PROGS) +$(CMDS): $(TESTDIR_pkcs) $(TESTDIR_kcf) $(PROGS) -$(TESTDIR): +$(TESTDIR_pkcs) $(TESTDIR_kcf): $(INS.dir) -$(TESTROOT)/%/aes/$(PROG): $(PROG)_% +$(TESTDIR_pkcs)/%_32: %_32_pkcs + $(INS.rename) + +$(TESTDIR_pkcs)/%_64: %_64_pkcs + $(INS.rename) + +$(TESTDIR_kcf)/%_32: %_32_kcf + $(INS.rename) + +$(TESTDIR_kcf)/%_64: %_64_kcf $(INS.rename) diff --git a/usr/src/test/crypto-tests/tests/modes/aes/cbc/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/cbc/Makefile index e74dc104bd..e7e36b988c 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/cbc/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/cbc/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_cbc +BASEPROG = aes_cbc include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs diff --git a/usr/src/test/crypto-tests/tests/modes/aes/ccm/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/ccm/Makefile index 28ec598193..ab91c27fda 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/ccm/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/ccm/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_ccm +BASEPROG = aes_ccm include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs diff --git a/usr/src/test/crypto-tests/tests/modes/aes/cmac/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/cmac/Makefile index c4e63db251..4c99aad1b6 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/cmac/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/cmac/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_cmac +BASEPROG = aes_cmac include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs diff --git a/usr/src/test/crypto-tests/tests/modes/aes/ctr/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/ctr/Makefile index a1a1d35425..adc2a9cb52 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/ctr/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/ctr/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_ctr +BASEPROG = aes_ctr include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs diff --git a/usr/src/test/crypto-tests/tests/modes/aes/ecb/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/ecb/Makefile index 00adfa3b43..d413f18329 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/ecb/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/ecb/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_ecb +BASEPROG = aes_ecb include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs diff --git a/usr/src/test/crypto-tests/tests/modes/aes/gcm/Makefile b/usr/src/test/crypto-tests/tests/modes/aes/gcm/Makefile index c480cf13f9..2cef165155 100644 --- a/usr/src/test/crypto-tests/tests/modes/aes/gcm/Makefile +++ b/usr/src/test/crypto-tests/tests/modes/aes/gcm/Makefile @@ -14,7 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -PROG = aes_gcm +BASEPROG = aes_gcm include $(SRC)/cmd/Makefile.cmd include ../Makefile.subdirs |