Skip to content

AES_CBC for wrapping  #574

@vas777

Description

@vas777

Thanks for such a nice library.

I was trying to extract RSA keys in PKCS#8 format. C_WrapKey is an encryption of PKCS#8 encoding, so I just attempted to first wrap the key with AES_CBC and then decrypt C_Decrypt wrapped data. This approach works fine for RSA of size 1024 and I see DER data of the key (using openssl asn1parse -inform DER -in file ), but for some reason with bigger keys 2048, 4096 and as well with EC types of keys I get CKR_GENERAL_ERROR from C_WrapKey and log shows
BotanSymmetricAlgorithm.cpp(311): Failed to encrypt the data

So I decided to ask what could be a reason for this problem? Is it a bug or an inherent problem with the approach ( some padding/size issue)?

Probably it is an incorrect way to do get PKCS#8, but because of this weird behavior and absence of a test for AES_CBC for wrapping I have decided to ask.

Thanks for your answer and your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions