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
2 changes: 1 addition & 1 deletion .github/workflows/alpine-architecture-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
cd wolfssl-${{ matrix.alpine_arch }}
./autogen.sh
./configure --enable-cryptocb --enable-aescfb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt --enable-md5 --enable-sha224 --enable-sha3 \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
make
shell: alpine.sh {0}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
working-directory: ./wolfssl
run: |
./configure --enable-cryptocb --enable-aescfb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt --enable-md5 \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
- name: wolfssl make install
working-directory: ./wolfssl
run: make
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
cd wolfssl
./autogen.sh
./configure --enable-cryptocb --enable-aescfb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt --enable-md5 \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
make -j$(nproc)
sudo make install
sudo ldconfig
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debian-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
working-directory: ./wolfssl
run: |
./configure --enable-cryptocb --enable-aescfb --enable-aesctr --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt --enable-md5 --enable-cmac \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
- name: wolfssl make and install
working-directory: ./wolfssl
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitizer-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
;;
esac
./configure --enable-cryptocb --enable-aescfb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt --enable-md5 --enable-debug \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
- name: wolfssl make
working-directory: ./wolfssl
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wolfssl-v5.6.6-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
working-directory: ./wolfssl
run: |
./configure --enable-cryptocb --enable-aescfb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt \
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
- name: wolfssl make install
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ./wolfssl
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Build wolfSSL:
git clone https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./autogen.sh
./configure --enable-aescfb --enable-cryptocb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
./configure --enable-aescfb --enable-cryptocb --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT -DHAVE_AES_ECB -DHAVE_AES_KEYWRAP"
make
make check
sudo make install
Expand Down
16 changes: 10 additions & 6 deletions src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ static CK_RV SetAttributeValue(WP11_Session* session, WP11_Object* obj,
}
ret = WP11_Object_SetAttr(obj, attr->type, (byte*)attr->pValue,
attr->ulValueLen);
if (ret == BAD_FUNC_ARG)
if (ret == MEMORY_E)
return CKR_DEVICE_MEMORY;
else if (ret == BAD_FUNC_ARG)
return CKR_ATTRIBUTE_VALUE_INVALID;
else if (ret == BUFFER_E)
return CKR_BUFFER_TOO_SMALL;
Expand Down Expand Up @@ -884,7 +886,8 @@ static CK_RV AddRSAPrivateKeyObject(WP11_Session* session,
err_out:
if (rv != CKR_OK) {
if (*phKey != CK_INVALID_HANDLE) {
WP11_Session_RemoveObject(session, privKeyObject);
/* ignore return value, logged in function */
(void)WP11_Session_RemoveObject(session, privKeyObject);
*phKey = CK_INVALID_HANDLE;
}
if (privKeyObject != NULL) {
Expand Down Expand Up @@ -1050,7 +1053,8 @@ CK_RV C_CreateObject(CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate,
}
rv = AddObject(session, object, pTemplate, ulCount, phObject);
if (rv != CKR_OK) {
WP11_Session_RemoveObject(session, object);
/* ignore return value, logged in function */
(void)WP11_Session_RemoveObject(session, object);
WP11_Object_Free(object);
}

Expand Down Expand Up @@ -1232,10 +1236,9 @@ CK_RV C_DestroyObject(CK_SESSION_HANDLE hSession,
return rv;
}

WP11_Session_RemoveObject(session, obj);
rv = WP11_Session_RemoveObject(session, obj);
WP11_Object_Free(obj);

rv = CKR_OK;
WOLFPKCS11_LEAVE("C_DestroyObject", rv);
return rv;
}
Expand Down Expand Up @@ -6731,7 +6734,8 @@ CK_RV C_UnwrapKey(CK_SESSION_HANDLE hSession,
}
if (rv != CKR_OK) {
if (*phKey != CK_INVALID_HANDLE) {
WP11_Session_RemoveObject(session, keyObj);
/* ignore return value, logged in function */
(void)WP11_Session_RemoveObject(session, keyObj);
*phKey = CK_INVALID_HANDLE;
}
if (keyObj != NULL) {
Expand Down
Loading
Loading