#include <openssl/rsa.h>
#include <openssl/rand.h>
+#ifndef RSA_NULL
+
static int RSA_eay_public_encrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa,int padding);
static int RSA_eay_private_encrypt(int flen, unsigned char *from,
if (rsa->flags & RSA_FLAG_BLINDING)
if (!BN_BLINDING_convert(&f,rsa->blinding,ctx)) goto err;
- if ( (rsa->p != NULL) &&
+ if ( (rsa->flags & RSA_FLAG_EXT_PKEY) ||
+ ((rsa->p != NULL) &&
(rsa->q != NULL) &&
(rsa->dmp1 != NULL) &&
(rsa->dmq1 != NULL) &&
- (rsa->iqmp != NULL))
+ (rsa->iqmp != NULL)) )
{ if (!rsa->meth->rsa_mod_exp(&ret,&f,rsa)) goto err; }
else
{
goto err;
}
- /* This check was for equallity but PGP does evil things
+ /* This check was for equality but PGP does evil things
* and chops off the top '0' bytes */
if (flen > num)
{
if (!BN_BLINDING_convert(&f,rsa->blinding,ctx)) goto err;
/* do the decrypt */
- if ( (rsa->p != NULL) &&
+ if ( (rsa->flags & RSA_FLAG_EXT_PKEY) ||
+ ((rsa->p != NULL) &&
(rsa->q != NULL) &&
(rsa->dmp1 != NULL) &&
(rsa->dmq1 != NULL) &&
- (rsa->iqmp != NULL))
+ (rsa->iqmp != NULL)) )
{ if (!rsa->meth->rsa_mod_exp(&ret,&f,rsa)) goto err; }
else
{
goto err;
}
- /* This check was for equallity but PGP does evil things
+ /* This check was for equality but PGP does evil things
* and chops off the top '0' bytes */
if (flen > num)
{
return(1);
}
-
+#endif