Skip to content
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

Bring in support for MAXQ1065 #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

anhu
Copy link
Member

@anhu anhu commented Jan 10, 2025

  • support for committing certificate into MAXQ
  • use the specified devId that is saved in the slot or session

- support for committing certificate into MAXQ
- use the specified devId that is saved in the slot or session

NOTE: requires wolfpkcs11/port/maxim directory be created and MXQ_API header
      files be copied in there.
@anhu anhu requested a review from wolfSSL-Bot January 10, 2025 18:34
@anhu anhu self-assigned this Jan 10, 2025
@anhu
Copy link
Member Author

anhu commented Jan 10, 2025

NOTE: requires wolfpkcs11/port/maxim directory be created and MXQ_API header files be copied in there.

This would be done by scripts in the MAXQ10xx SDK.

@anhu anhu assigned wolfSSL-Bot and unassigned anhu Jan 10, 2025
@@ -2621,7 +2621,7 @@ CK_RV C_DigestFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest,
CK_RV C_SignInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism,
CK_OBJECT_HANDLE hKey)
{
int ret;
int ret = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need this change.

WP11_Session_SetOpInitialized(session, init);

return CKR_OK;
} else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
else

if (ret != 0)
#ifdef WOLFSSL_MAXQ10XX_CRYPTO
if ((ret != 0) && (hKey == 0) && (pMechanism->mechanism == CKM_ECDSA)) {
if (pMechanism->pParameter != NULL || pMechanism->ulParameterLen != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check for devId being set?

@dgarske dgarske requested review from dgarske and removed request for wolfSSL-Bot January 21, 2025 00:42
@@ -1697,6 +1706,270 @@ static int wp11_Object_Load_Cert(WP11_Object* object, int tokenId, int objId)
return ret;
}

#ifdef WOLFSSL_MAXQ10XX_CRYPTO
#ifdef MAXQ10XX_PRODUCTION_KEY
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a section in the documentation for MAXQ and the use of MAXQ10XX_PRODUCTION_KEY. Thank you

#include "maxq10xx_key.h"
#else
/* TEST KEY. This must be changed for production environments!! */
static mxq_u1 KeyPairImport[] = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

DecodedCert decodedCert;
byte *certBody = NULL;

mxq_u1 signature[256];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid hard coded signature size, please use macro if possible. Same for 32 and 2048 below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants