Skip to content

Commit

Permalink
whitespace, dead code, better macro
Browse files Browse the repository at this point in the history
  • Loading branch information
anhu committed Nov 13, 2024
1 parent 9d69ee4 commit b9ebac8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/asn_public.h>

#include <wolfpkcs11/pkcs11.h>
#include <wolfpkcs11/internal.h>
Expand Down Expand Up @@ -2480,7 +2479,7 @@ CK_RV C_SignInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism,
return CKR_ARGUMENTS_BAD;

ret = WP11_Object_Find(session, hKey, &obj);
#if 1
#ifdef WOLFSSL_MAXQ10XX_CRYPTO
if ((ret != 0) && (hKey == 0) && (pMechanism->mechanism == CKM_ECDSA)) {
if (pMechanism->pParameter != NULL || pMechanism->ulParameterLen != 0) {
return CKR_MECHANISM_PARAM_INVALID;
Expand Down
15 changes: 1 addition & 14 deletions tests/pkcs11test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2935,19 +2935,7 @@ static CK_RV test_pubkey_sig_fail(CK_SESSION_HANDLE session, CK_MECHANISM* mech,
}
if (ret == CKR_OK) {
ret = funcList->C_Sign(session, hash, hashSz, out, &outSz);
#if 0
#ifdef WOLFSSL_MAXQ10XX_CRYPTO
if (mech->mechanism == CKM_ECDSA) {
/* In the case of MAXQ10XX the ECC private key is pre-provisioned
* so its fine to call it in this state */
CHECK_CKR(ret, "Sign");
} else
#endif
#endif
{
CHECK_CKR_FAIL(ret, CKR_OPERATION_NOT_INITIALIZED,
"Sign wrong init");
}
CHECK_CKR_FAIL(ret, CKR_OPERATION_NOT_INITIALIZED, "Sign wrong init");
}

return ret;
Expand Down Expand Up @@ -4533,7 +4521,6 @@ static CK_RV find_ecc_priv_key(CK_SESSION_HANDLE session,
int idLen)
{
CK_RV ret = CKR_OK;

CK_ATTRIBUTE privKeyTmpl[] = {
{ CKA_CLASS, &privKeyClass, sizeof(privKeyClass) },
{ CKA_KEY_TYPE, &eccKeyType, sizeof(eccKeyType) },
Expand Down

0 comments on commit b9ebac8

Please sign in to comment.