From b4899bb1fab649891d2d3f678454ab0508477e4e Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Fri, 12 Mar 1999 20:41:09 +0000 Subject: [PATCH] Fail if test fails. --- CHANGES | 3 +++ crypto/rsa/rsa_oaep_test.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8af4c3ce85..8aebef5884 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes between 0.9.1c and 0.9.2 + *) Make rsa_oaep_test return non-zero on error. + [Ulf Moeller ] + *) Add support for native Solaris shared libraries. Configure solaris-sparc-sc4-pic, make, then run shlib/solaris-sc4.sh. It'd be nice if someone would make that last step automatic. diff --git a/crypto/rsa/rsa_oaep_test.c b/crypto/rsa/rsa_oaep_test.c index 43d70bf5d6..5fcc2f7a87 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]; @@ -216,6 +217,7 @@ int main() if (num != clen) { printf("Encryption failed!\n"); + err=1; goto next; } @@ -224,6 +226,7 @@ int main() if (num != plen || memcmp(ptext, ptext_ex, num) != 0) { printf("Decryption failed!\n"); + err=1; goto next; } @@ -240,12 +243,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; } -- GitLab