X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Frsa%2Frsa_oaep_test.c;h=57e10e9a08be590adf6e1c6f282e53d85d69c826;hp=43d70bf5d6ec5c88f3e3e776abbc99687510fe71;hb=0e9fc7115b89e672d74fe48f6a2120d8f10d5d97;hpb=04fa4cb72122e29db2686b1390720b007e55b7c1 diff --git a/crypto/rsa/rsa_oaep_test.c b/crypto/rsa/rsa_oaep_test.c index 43d70bf5d6..57e10e9a08 100644 --- a/crypto/rsa/rsa_oaep_test.c +++ b/crypto/rsa/rsa_oaep_test.c @@ -184,6 +184,7 @@ int key3(RSA *key, unsigned char *c) int main() { + int err=0; int v; RSA *key; unsigned char ptext[256]; @@ -194,6 +195,11 @@ int main() int clen = 0; int num; +#ifdef RSAref + printf("No OAEP support with RSAref - skipping test\n"); + return 0; +#endif + plen = sizeof(ptext_ex) - 1; for (v = 0; v < 3; v++) @@ -216,6 +222,7 @@ int main() if (num != clen) { printf("Encryption failed!\n"); + err=1; goto next; } @@ -224,6 +231,7 @@ int main() if (num != plen || memcmp(ptext, ptext_ex, num) != 0) { printf("Decryption failed!\n"); + err=1; goto next; } @@ -240,12 +248,15 @@ int main() RSA_PKCS1_OAEP_PADDING); if (num != plen || memcmp(ptext, ptext_ex, num) != 0) + { printf("Decryption failed!\n"); + err=1; + } else - printf("Encyption/decryption successful!\n"); + printf("Encryption/decryption successful!\n"); next: RSA_free(key); } - return (0); + return err; }