> -----Original Message----- > From: owner-openssl-us...@openssl.org [mailto:owner-openssl- > us...@openssl.org] On Behalf Of Jeffrey Walton > Sent: Sunday, July 29, 2012 4:13 AM > To: openssl-users@openssl.org > Subject: Re: Padding check failed and program crash with SIGABRT. > > On Sat, Jul 28, 2012 at 6:12 PM, Tayade, Nilesh > <nilesh.tay...@netscout.com> wrote: > > Hi, [...]
> > > > I see that the error it is trying to give is related to Padding check > failure. > > 1. How to decide the padding? By default I keep it to > RSA_PKCS1_PADDING always in RSA_private_decrypt(). > > 2. Is there no graceful way to give such error than crashing? > > 3. What could be the cause of padding check failed? On searching, I > found some discussions mentioning about key-certificate mismatch. > > But in my case it decrypts few of the initial packets. > > Somewhat related: you should be using OAEP, not PKCS1 padding. Matt > Greene has a nice write-up at > http://blog.cryptographyengineering.com/2012/06/bad-couple-of-years- > for-cryptographic.html. Thanks Jeff. I tried using RSA_PKCS1_OAEP_PADDING for few of the data packets, but it fails with 'incorrect padding' error. > > Jeff -- Thanks, Nilesh