On Wed, Mar 06, 2013, Bruce Stephens wrote:

> "Dr. Stephen Henson" <steve-mcmkbn63+blafugrpc6...@public.gmane.org>
> writes:
> 
> [...]
> 
> > RSA_private_decrypt is fine [...]
> 
> Is it? It begins with discouraging-looking code:
> 
>     int RSA_private_decrypt(int flen, const unsigned char *from, unsigned 
> char *to,
>            RSA *rsa, int padding)
>       {
>     #ifdef OPENSSL_FIPS
>       if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD)
>                       && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW))
>               {
>               RSAerr(RSA_F_RSA_PRIVATE_DECRYPT, RSA_R_NON_FIPS_RSA_METHOD);
>               return -1;
>               }
>     #endif

Validated RSA_METHOD structures set RSA_FLAG_FIPS_METHOD, so that will work
with the FIPS module.

That code is there so you can't accidentally use an unvalidated method (e.g.
from an ENGINE) in FIPS mode but if you are sure it is acceptable it can be
overridden by setting RSA_FLAG_NON_FIPS_ALLOW in the key.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to