Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 56 additions & 7 deletions .github/workflows/zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ on: [workflow_call, workflow_dispatch]

jobs:

zephyr_test:
zephyr3_test:
runs-on: oqs-x64
container: ghcr.io/zephyrproject-rtos/ci:v0.27.4
container: ghcr.io/zephyrproject-rtos/ci:v0.26-branch
Comment thread
bhess marked this conversation as resolved.
env:
CMAKE_PREFIX_PATH: /opt/toolchains
strategy:
fail-fast: false
matrix:
config:
- zephyr-ref: v3.4.0
- zephyr-ref: v3.7.0

steps:
- name: Init Zephyr workspace
run: |
mkdir zephyr && cd zephyr
mkdir manifest && cd manifest
mkdir -p zephyr/manifest && cd zephyr/manifest
echo "manifest:" > west.yml
echo " remotes:" >> west.yml
echo " - name: zephyr" >> west.yml
Expand Down Expand Up @@ -53,9 +51,60 @@ jobs:
- name: Run Signature test
working-directory: zephyr
run: |
west twister --integration -T modules/crypto/liboqs/zephyr -s samples/Signatures/sample.crypto.liboqs_signature_example -vvv
west twister --integration -T modules/crypto/liboqs/zephyr/samples/Signatures -vvv

- name: Run KEM test
working-directory: zephyr
run: |
west twister --integration -T modules/crypto/liboqs/zephyr -s samples/KEMs/sample.crypto.liboqs_kem_example -vvv
west twister --integration -T modules/crypto/liboqs/zephyr/samples/KEMs -vvv

zephyr4_test:
runs-on: oqs-x64
container: ghcr.io/zephyrproject-rtos/ci:v0.28.7
env:
CMAKE_PREFIX_PATH: /opt/toolchains
strategy:
fail-fast: false
matrix:
config:
- zephyr-ref: v4.3.0

steps:
- name: Init Zephyr workspace
run: |
mkdir -p zephyr/manifest && cd zephyr/manifest
echo "manifest:" > west.yml
echo " remotes:" >> west.yml
echo " - name: zephyr" >> west.yml
echo " url-base: https://github.com/zephyrproject-rtos" >> west.yml
echo " - name: liboqs" >> west.yml
echo " url-base: https://github.com/${{ github.repository_owner }}" >> west.yml
echo " projects:" >> west.yml
echo " - name: zephyr" >> west.yml
echo " remote: zephyr" >> west.yml
echo " repo-path: zephyr" >> west.yml
echo " revision: ${{ matrix.config.zephyr-ref }}" >> west.yml
echo " import:" >> west.yml
echo " name-allowlist:" >> west.yml
echo " - picolibc" >> west.yml
echo " - name: liboqs" >> west.yml
echo " remote: liboqs" >> west.yml
echo " revision: $(echo '${{ github.ref }}' | sed -e 's/refs\/heads\///')" >> west.yml
echo " path: modules/crypto/liboqs" >> west.yml
west init -l --mf west.yml .

- name: Update west workspace
working-directory: zephyr
run: |
west update -n -o=--depth=1
west zephyr-export

- name: Run Signature test
working-directory: zephyr
run: |
west twister --integration -T modules/crypto/liboqs/zephyr/samples/Signatures -vvv

- name: Run KEM test
working-directory: zephyr
run: |
west twister --integration -T modules/crypto/liboqs/zephyr/samples/KEMs -vvv
7 changes: 7 additions & 0 deletions src/common/common.c
Comment thread
xuganyu96 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ OQS_API void *OQS_MEM_calloc(size_t num_elements, size_t element_size) {
OQS_API char *OQS_MEM_strdup(const char *str) {
#if defined(OQS_USE_OPENSSL)
return OSSL_FUNC(CRYPTO_strdup)(str, OPENSSL_FILE, OPENSSL_LINE);
#elif defined(OQS_EMBEDDED_BUILD)
size_t len = strlen(str) + 1;
char *dup = (char *)malloc(len); // IGNORE memory-check
if (dup != NULL) {
memcpy(dup, str, len);
}
return dup;
#else
return strdup(str); // IGNORE memory-check
#endif
Expand Down
2 changes: 0 additions & 2 deletions zephyr/samples/KEMs/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ CONFIG_LIBOQS_ENABLE_KEM_KYBER=y
CONFIG_PICOLIBC=y
CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_POSIX_CLOCK=n
Comment thread
xuganyu96 marked this conversation as resolved.

# Set the stack size to 512K
CONFIG_MAIN_STACK_SIZE=524288

Expand Down
2 changes: 0 additions & 2 deletions zephyr/samples/Signatures/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ CONFIG_LIBOQS_ENABLE_SIG_ML_DSA=y
CONFIG_PICOLIBC=y
CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_POSIX_CLOCK=n

# Set the stack size to 512K
CONFIG_MAIN_STACK_SIZE=524288

Expand Down