Skip to content

PKCS#11 Debug Attributes Compilation Error #421

Description

@aroberts109

Describe the bug
The binary input buffer pointer is incorrectly passed as the size of the buffer instead of the length of the buffer.

A compiler error may be thrown due to incompatible conversion from CK_VOID_PTR to size_t

(void)atcab_bin2hex_(pTemplate->pValue, pTemplate->pValue, buffer, &buf_len, false, true, true);

- (void)atcab_bin2hex_(pTemplate->pValue, pTemplate->pValue, buffer, &buf_len, false, true, true);
+ (void)atcab_bin2hex_(pTemplate->pValue, pTemplate->ulValueLen, buffer, &buf_len, false, true, true);

To Reproduce
Compile cryptoauthlib with PKCS11 enabled and PKCS11_DEBUG_ENABLE

Expected behavior
Compilation is successful

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions