|
Hi,
I'm working on PKCS#7 Signed-and-enveloped-data
type with OpenSSL. Following steps are
performed to extract and verify this content type: // translate RSA private key to internal
structure and assign EVP key structure
// translate Recipient X509(DER) to
internal structure
// Create BIO for storing data and load
packed PKCS7 object from data
// Verify certificate
// Decode cipher key -- call
PKCS7_dataDecode( )
// Call BIO_read() to decrypt the ciphertext packed in digital envelop // Verify signatures The problem is: when the length of
plaintext is less then one block(8 characters), such as
"ABCDE",
the function "BIO_read(...)" would fail to decrypt ciphertext. Instead of returning the accurate length of plaintext, it return "1" as length. And when verifying signature, certainly it failed again. However, when the length of plaintext is more then 8, it works smoothly. Does anybody bump into the same situation? Pls kindly share your experience! Thanks!
|
- Re: PKCS#7 Signed&Envelop problem Cathy Yeh
- Re: PKCS#7 Signed&Envelop problem Manuel Mollar
