This is a discussion on Issues during Decryption - Openssl ; Hi Users I am using openssl in my Application. It works on 32 bit Linux environment. Now I am porting my application to 64 Bit on HP-UX. I compiled the library with aCC -c +O2 -g +DD64 +Z -D_HPUX_SOURCE -DRW_MULTI_THREAD ...
I am using openssl in my Application. It works on 32 bit Linux
environment. Now I am porting my application to
64 Bit on HP-UX. I compiled the library with aCC -c +O2 -g +DD64 +Z
-D_HPUX_SOURCE -DRW_MULTI_THREAD -D_REENTRANT
flags. The shared library got successfully created and the
libsecuritymodule.sl is archive of all 64-Bit objects (ELF-64 relocatable
object files - IA64).
The problem that I am facing is
(Nested Function call flow)
(SecurityWrap1.cpp) (decrypt.c) (smime.c) (pk7_smime1.c)
VerifyAndDecrypt ( ) -> DecryptMessage( ) -> openssl( ) ->
PKCS7_decrypt( ) -> PKCS7_dataDecode( ) -> EVP_PKEY_decrypt( ) ->
RSA_private_decrypt( ) Line:233 -> RSA_eay_private_decrypt( ) ->
Padding Check logic returns -1 ( Which says Padding Check failed / Block
Type is not O2). This causes openssl to return 4 as error code, and
I think the issue is related to computation of BIGNUM by function
BN_bn2bin( ) in bn_lib.c.
This is piece of code from rsa_pk1_1.c (forgive me for pasting the code
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
unsigned char *from, int flen, int num)
unsigned char *p;
if ((num != (flen+1)) || (*(p++) != 02))
The num variable is 128 while flen is 178. So the if condition gets
validated and this returns Error.
Please help me what is wrong here?
Tata Consultancy Services
Experience certainty. IT Services
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you