add wc_RsaKeyToPublicDer in asn.c when OPENSSL_EXTRA, fix wolfSSL_i2d_RSAPublicKey

This commit is contained in:
Takashi Kojo
2018-05-04 08:32:13 +09:00
parent 03846b2d2d
commit 138f9f8f66
2 changed files with 5 additions and 5 deletions

View File

@@ -27520,21 +27520,20 @@ int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp)
if((ret = SetRsaInternal(rsa)) != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("SetRsaInternal Failed");
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
return _REXT_OK;
return ret;
}
#if 0
if((ret = wc_RsaKeyToPublicDer((RsaKey *)rsa->internal, der, derLen)) < 0){
WOLFSSL_MSG("RsaKeyToPublicDer failed");
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
return ret;
}
#endif
*pp = der;
return ret;
}
/* return WOLFSSL_SUCCESS if success, WOLFSSL_FATAL_ERROR if error */
int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz)
{

View File

@@ -8186,7 +8186,7 @@ int wc_PemPubKeyToDer(const char* fileName,
#if !defined(NO_RSA) && (defined(WOLFSSL_CERT_GEN) || \
(defined(WOLFSSL_KEY_GEN) && !defined(HAVE_USER_RSA)))
((defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA)) && !defined(HAVE_USER_RSA)))
/* USER RSA ifdef portions used instead of refactor in consideration for
possible fips build */
/* Write a public RSA key to output */
@@ -8438,8 +8438,9 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
return outLen;
}
#endif
#if (defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA)) && !defined(NO_RSA) && !defined(HAVE_USER_RSA)
/* Convert Rsa Public key to DER format, write to output (inLen), return bytes
written */
int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen)