forked from wolfSSL/wolfssl
add wc_RsaKeyToPublicDer in asn.c when OPENSSL_EXTRA, fix wolfSSL_i2d_RSAPublicKey
This commit is contained in:
@@ -27520,21 +27520,20 @@ int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp)
|
|||||||
if((ret = SetRsaInternal(rsa)) != WOLFSSL_SUCCESS) {
|
if((ret = SetRsaInternal(rsa)) != WOLFSSL_SUCCESS) {
|
||||||
WOLFSSL_MSG("SetRsaInternal Failed");
|
WOLFSSL_MSG("SetRsaInternal Failed");
|
||||||
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
return _REXT_OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
if((ret = wc_RsaKeyToPublicDer((RsaKey *)rsa->internal, der, derLen)) < 0){
|
if((ret = wc_RsaKeyToPublicDer((RsaKey *)rsa->internal, der, derLen)) < 0){
|
||||||
WOLFSSL_MSG("RsaKeyToPublicDer failed");
|
WOLFSSL_MSG("RsaKeyToPublicDer failed");
|
||||||
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
*pp = der;
|
*pp = der;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* return WOLFSSL_SUCCESS if success, WOLFSSL_FATAL_ERROR if error */
|
/* return WOLFSSL_SUCCESS if success, WOLFSSL_FATAL_ERROR if error */
|
||||||
int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz)
|
int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz)
|
||||||
{
|
{
|
||||||
|
@@ -8186,7 +8186,7 @@ int wc_PemPubKeyToDer(const char* fileName,
|
|||||||
|
|
||||||
|
|
||||||
#if !defined(NO_RSA) && (defined(WOLFSSL_CERT_GEN) || \
|
#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
|
/* USER RSA ifdef portions used instead of refactor in consideration for
|
||||||
possible fips build */
|
possible fips build */
|
||||||
/* Write a public RSA key to output */
|
/* Write a public RSA key to output */
|
||||||
@@ -8438,8 +8438,9 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
|
|||||||
|
|
||||||
return outLen;
|
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
|
/* Convert Rsa Public key to DER format, write to output (inLen), return bytes
|
||||||
written */
|
written */
|
||||||
int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen)
|
int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen)
|
||||||
|
Reference in New Issue
Block a user