-
Notifications
You must be signed in to change notification settings - Fork 20
Added interoperability test against wolfSSL master #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f4db2ad
Added interoperability test against wolfSSL master
danielinux cd8f478
Added test to unit-test.yml
danielinux befc040
Adjust test working dir
danielinux acf2858
Added missing makefile, previously ignored.
danielinux 2c0dea9
Addressed reviewer's comment
danielinux 1fbd72f
Added possible missing .o
danielinux 71a1a0b
Added non-zero AAD for AES_GCM interop test
danielinux fae1b00
Replaced AES-GCM test vector with NIST SP 800-38D Test Case 4
danielinux 08a5597
Run the interop test also nightly, remove from unit workflow
danielinux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: wolfPKCS11 interoperability tests against wolfSSL upstream | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 'master', 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
| schedule: | ||
| - cron: "0 1 * * *" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| #pull wolfPKCS11 | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| #setup wolfssl at master branch | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| repository: wolfssl/wolfssl | ||
| ref: master | ||
| path: wolfssl | ||
|
|
||
| # build + run tests | ||
| - name: Build and run interoperability test | ||
| working-directory: ./ | ||
| run: make -C tests/wolfssl-interoperability | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| CC ?= gcc | ||
| AR ?= ar | ||
| CFLAGS ?= -O2 -g | ||
| CFLAGS += -Wall -Wextra -Wno-unused-parameter -fPIC | ||
| LDFLAGS ?= | ||
| LDLIBS ?= | ||
| LDLIBS += -ldl -lpthread -lm | ||
| WOLFSSL_DIR ?= ../../wolfssl | ||
| WOLFPKCS11_DIR ?= ../.. | ||
|
|
||
| BUILD_DIR := build | ||
|
|
||
| COMMON_CPPFLAGS := -DWOLFSSL_USER_SETTINGS -I. -I.. \ | ||
| -I$(WOLFSSL_DIR) -I$(WOLFSSL_DIR)/wolfssl -I$(WOLFSSL_DIR)/wolfssl/wolfcrypt \ | ||
| -I$(WOLFPKCS11_DIR) -I$(WOLFPKCS11_DIR)/wolfpkcs11 -I$(WOLFPKCS11_DIR)/src | ||
| WOLFCRYPT_CPPFLAGS := $(COMMON_CPPFLAGS) -DWOLFSSL_LIB | ||
| ENGINE_CPPFLAGS := $(COMMON_CPPFLAGS) -DBUILDING_WOLFPKCS11 -DDEBUG_WOLFPKCS11 | ||
| TEST_CPPFLAGS := $(COMMON_CPPFLAGS) | ||
|
|
||
| WOLFCRYPT_SRCS := \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/aes.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/asn.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/coding.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/cryptocb.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/des3.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/dsa.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/dh.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/ecc.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/ecc_fp.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/error.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/hash.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/md5.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/hmac.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/integer.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/logging.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/memory.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/random.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/kdf.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/rsa.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sha.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sha256.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sha512.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sha3.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/signature.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/pwdbased.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sp_int.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/sp_c32.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/wc_encrypt.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/wc_pkcs11.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/wc_port.c \ | ||
| $(WOLFSSL_DIR)/wolfcrypt/src/wolfmath.c | ||
|
|
||
| ENGINE_SRCS := \ | ||
| $(WOLFPKCS11_DIR)/src/internal.c \ | ||
| $(WOLFPKCS11_DIR)/src/wolfpkcs11.c \ | ||
| $(WOLFPKCS11_DIR)/src/slot.c \ | ||
| $(WOLFPKCS11_DIR)/src/crypto.c | ||
|
|
||
| TEST_SRCS := pkcs11_interop.c | ||
|
|
||
| WOLFCRYPT_OBJS := $(patsubst $(WOLFSSL_DIR)/%.c,$(BUILD_DIR)/wolfssl/%.o,$(WOLFCRYPT_SRCS)) | ||
| ENGINE_OBJS := $(patsubst $(WOLFPKCS11_DIR)/%.c,$(BUILD_DIR)/wolfpkcs11/%.o,$(ENGINE_SRCS)) | ||
| TEST_OBJS := $(patsubst %.c,$(BUILD_DIR)/interop-test/%.o,$(TEST_SRCS)) | ||
|
|
||
| all: test | ||
|
|
||
| interop: $(BUILD_DIR)/pkcs11_interop | ||
|
|
||
| $(BUILD_DIR)/wolfssl/%.o: $(WOLFSSL_DIR)/%.c | ||
| @mkdir -p $(dir $@) | ||
| $(CC) $(CPPFLAGS) $(WOLFCRYPT_CPPFLAGS) $(CFLAGS) -c $< -o $@ | ||
|
|
||
| $(BUILD_DIR)/wolfpkcs11/%.o: $(WOLFPKCS11_DIR)/%.c | ||
| @mkdir -p $(dir $@) | ||
| $(CC) $(CPPFLAGS) $(ENGINE_CPPFLAGS) $(CFLAGS) -c $< -o $@ | ||
|
|
||
| $(BUILD_DIR)/interop-test/%.o: %.c | ||
| @mkdir -p $(dir $@) | ||
| $(CC) $(CPPFLAGS) $(TEST_CPPFLAGS) $(CFLAGS) -c $< -o $@ | ||
|
|
||
| $(BUILD_DIR)/libwolfcrypt-interop.so: $(WOLFCRYPT_OBJS) | ||
| @mkdir -p $(dir $@) | ||
| $(CC) -shared -o $@ $(WOLFCRYPT_OBJS) $(LDFLAGS) $(LDLIBS) | ||
|
|
||
| $(BUILD_DIR)/libwolfpkcs11-interop.so: $(ENGINE_OBJS) $(BUILD_DIR)/libwolfcrypt-interop.so | ||
| @mkdir -p $(dir $@) | ||
| $(CC) -shared -o $@ $(ENGINE_OBJS) -L$(BUILD_DIR) -lwolfcrypt-interop $(LDFLAGS) $(LDLIBS) | ||
|
|
||
| $(BUILD_DIR)/pkcs11_interop: $(TEST_OBJS) $(BUILD_DIR)/libwolfpkcs11-interop.so $(BUILD_DIR)/libwolfcrypt-interop.so | ||
| $(CC) -o $@ $(TEST_OBJS) -L$(BUILD_DIR) -lwolfpkcs11-interop -lwolfcrypt-interop $(LDFLAGS) $(LDLIBS) | ||
|
|
||
| .PHONY: test | ||
| test: $(BUILD_DIR)/pkcs11_interop | ||
| WOLFPKCS11_MODULE=$(BUILD_DIR)/libwolfpkcs11-interop.so LD_LIBRARY_PATH=$(BUILD_DIR) $(BUILD_DIR)/pkcs11_interop | ||
| debug: $(BUILD_DIR)/pkcs11_interop | ||
| WOLFPKCS11_MODULE=$(BUILD_DIR)/libwolfpkcs11-interop.so LD_LIBRARY_PATH=$(BUILD_DIR) gdb $(BUILD_DIR)/pkcs11_interop | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| rm -rf $(BUILD_DIR)/wolfssl $(BUILD_DIR)/wolfPKCS11 $(BUILD_DIR)/interop-test \ | ||
| $(BUILD_DIR)/libwolfcrypt-interop.so $(BUILD_DIR)/libwolfpkcs11-interop.so \ | ||
| $(BUILD_DIR)/pkcs11_interop | ||
| rm -rf token-store | ||
| @# Safely remove build directory, if local | ||
| rm -rf ./build |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.