mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fix user-rsa tests
This commit is contained in:
12
tests/api.c
12
tests/api.c
@ -12285,11 +12285,12 @@ static int test_wc_RsaKeyToDer (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef HAVE_USER_RSA
|
#ifndef HAVE_USER_RSA
|
||||||
/* Pass bad args. */
|
/* Pass good/bad args. */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = wc_RsaKeyToDer(NULL, der, FOURK_BUF);
|
ret = wc_RsaKeyToDer(NULL, der, FOURK_BUF);
|
||||||
if (ret == BAD_FUNC_ARG) {
|
if (ret == BAD_FUNC_ARG) {
|
||||||
ret = wc_RsaKeyToDer(&genKey, NULL, FOURK_BUF);
|
/* Get just the output length */
|
||||||
|
ret = wc_RsaKeyToDer(&genKey, NULL, 0);
|
||||||
}
|
}
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
/* Try Public Key. */
|
/* Try Public Key. */
|
||||||
@ -12303,13 +12304,14 @@ static int test_wc_RsaKeyToDer (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Pass bad args. */
|
/* Pass good/bad args. */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = wc_RsaKeyToDer(NULL, der, FOURK_BUF);
|
ret = wc_RsaKeyToDer(NULL, der, FOURK_BUF);
|
||||||
if (ret == USER_CRYPTO_ERROR) {
|
if (ret == USER_CRYPTO_ERROR) {
|
||||||
ret = wc_RsaKeyToDer(&genKey, NULL, FOURK_BUF);
|
/* Get just the output length */
|
||||||
|
ret = wc_RsaKeyToDer(&genKey, NULL, 0);
|
||||||
}
|
}
|
||||||
if (ret == USER_CRYPTO_ERROR) {
|
if (ret > 0) {
|
||||||
/* Try Public Key. */
|
/* Try Public Key. */
|
||||||
genKey.type = 0;
|
genKey.type = 0;
|
||||||
ret = wc_RsaKeyToDer(&genKey, der, FOURK_BUF);
|
ret = wc_RsaKeyToDer(&genKey, der, FOURK_BUF);
|
||||||
|
Reference in New Issue
Block a user