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

Missing memcpy in akv_pkey_rsa_sign #20

Open
markehack opened this issue May 14, 2024 · 0 comments
Open

Missing memcpy in akv_pkey_rsa_sign #20

markehack opened this issue May 14, 2024 · 0 comments

Comments

@markehack
Copy link

The spec says that the length needs to be set on the return, so the length check is superfluous and the copy is missing from the else which then returns whatever was in memory and not the signature

   Log(LogLevel_Debug, "Signed successfully signature.size=[%zu]\n", signatureText.size);

    if (*siglen == signatureText.size)
    {
        memcpy(sig, signatureText.memory, signatureText.size);
    }
    else
    {  
        Log(LogLevel_Debug, "size prob = %zu\n", signatureText.size);
        memcpy(sig, signatureText.memory, signatureText.size);               // The spec says copy and set the length.
        *siglen = signatureText.size;                              
    }
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

No branches or pull requests

1 participant