From 49f56637dd22e4a7b21187190845bdf93f225b6c Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Sun, 19 Mar 2000 11:13:56 +0000 Subject: OpenSSL 0.9.5 merge *warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/) on cvs or ~beck/src-patent.tar.gz on cvs --- lib/libssl/test/Makefile.ssl | 58 ++++---- lib/libssl/test/dsa-ca.pem | 43 ------ lib/libssl/test/dsa-pca.pem | 49 ------- lib/libssl/test/maketests.com | 30 +++- lib/libssl/test/rsa_test.c | 314 ++++++++++++++++++++++++++++++++++++++++++ lib/libssl/test/tcrl.com | 23 ++-- lib/libssl/test/testca.com | 4 +- lib/libssl/test/testenc.com | 18 ++- lib/libssl/test/testgen | 2 + lib/libssl/test/testgen.com | 5 + lib/libssl/test/tests.com | 16 +-- lib/libssl/test/testssl | 6 + lib/libssl/test/testssl.com | 8 ++ lib/libssl/test/tpkcs7.com | 13 +- lib/libssl/test/tpkcs7d.com | 7 +- lib/libssl/test/treq.com | 23 ++-- lib/libssl/test/trsa.com | 23 ++-- lib/libssl/test/tsid.com | 23 ++-- lib/libssl/test/tx509.com | 23 ++-- 19 files changed, 497 insertions(+), 191 deletions(-) create mode 100644 lib/libssl/test/rsa_test.c (limited to 'lib/libssl/test') diff --git a/lib/libssl/test/Makefile.ssl b/lib/libssl/test/Makefile.ssl index ea865201286..dbb523bf15f 100644 --- a/lib/libssl/test/Makefile.ssl +++ b/lib/libssl/test/Makefile.ssl @@ -13,6 +13,7 @@ INSTALLTOP= /usr/local/ssl MAKEFILE= Makefile.ssl MAKE= make -f $(MAKEFILE) MAKEDEPEND= $(TOP)/util/domd $(TOP) +PERL= perl PEX_LIBS= EX_LIBS= #-lnsl -lsocket @@ -50,7 +51,7 @@ DHTEST= dhtest DSATEST= dsatest METHTEST= methtest SSLTEST= ssltest -RSATEST= rsa_oaep_test +RSATEST= rsa_test EXE= $(BNTEST) $(IDEATEST) $(MD2TEST) $(MD5TEST) $(HMACTEST) \ $(RC2TEST) $(RC4TEST) $(RC5TEST) \ @@ -98,9 +99,9 @@ tags: tests: exe apps \ test_des test_idea test_sha test_md5 test_hmac test_md2 test_mdc2 \ - test_rc2 test_rc4 test_rc5 test_bf test_cast \ + test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast \ test_rand test_bn test_enc test_x509 test_rsa test_crl test_sid \ - test_reqgen test_req test_pkcs7 test_verify test_dh test_dsa \ + test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ test_ss test_ssl test_ca apps: @@ -180,9 +181,10 @@ test_pkcs7: test_bn: @echo starting big number library test, could take a while... - @(./$(BNTEST)|bc) | awk '{ \ -if ($$0 != "0") {print "error"; exit(1); } \ -if (((NR+1)%64) == 0) print NR+1," tests done"; }' + @./$(BNTEST) >tmp.bntest + @echo quit >>tmp.bntest + @echo "running bc" + @bc tmp.bntest 2>&1 | $(PERL) -e 'while () {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} print STDERR "."; $$i++;} print STDERR "\n$$i tests passed\n"' @echo 'test a^b%c implementations' ./$(EXPTEST) @@ -192,14 +194,15 @@ test_verify: ../apps/openssl verify -CApath ../certs ../certs/*.pem test_dh: - @echo "Generate as set of DH parameters" + @echo "Generate a set of DH parameters" ./$(DHTEST) test_dsa: - @echo "Generate as set of DSA parameters" + @echo "Generate a set of DSA parameters" ./$(DSATEST) + ./$(DSATEST) -app2_1 -test_reqgen: +test_gen: @echo "Generate and verify a certificate request" @sh ./testgen @@ -226,7 +229,7 @@ dclean: mv -f Makefile.new $(MAKEFILE) clean: - rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log + rm -f .rnd tmp.bntest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log $(DLIBSSL): (cd ../ssl; $(MAKE)) @@ -325,16 +328,19 @@ destest.o: ../include/openssl/opensslconf.h dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h dhtest.o: ../include/openssl/stack.h dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h dsatest.o: ../include/openssl/dsa.h ../include/openssl/err.h dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dsatest.o: ../include/openssl/rand.h ../include/openssl/stack.h +dsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h +dsatest.o: ../include/openssl/stack.h exptest.o: ../include/openssl/bio.h ../include/openssl/bn.h exptest.o: ../include/openssl/crypto.h ../include/openssl/err.h exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -exptest.o: ../include/openssl/rand.h ../include/openssl/stack.h +exptest.o: ../include/openssl/rand.h ../include/openssl/safestack.h +exptest.o: ../include/openssl/stack.h hmactest.o: ../include/openssl/asn1.h ../include/openssl/bio.h hmactest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h hmactest.o: ../include/openssl/cast.h ../include/openssl/crypto.h @@ -359,11 +365,12 @@ rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h rc5test.o: ../include/openssl/rc5.h rmdtest.o: ../include/openssl/ripemd.h -rsa_oaep_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h -rsa_oaep_test.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h -rsa_oaep_test.o: ../include/openssl/err.h ../include/openssl/opensslconf.h -rsa_oaep_test.o: ../include/openssl/opensslv.h ../include/openssl/rsa.h -rsa_oaep_test.o: ../include/openssl/stack.h +rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h +rsa_test.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h +rsa_test.o: ../include/openssl/err.h ../include/openssl/opensslconf.h +rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/rand.h +rsa_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +rsa_test.o: ../include/openssl/stack.h sha1test.o: ../include/openssl/sha.h shatest.o: ../include/openssl/sha.h ssltest.o: ../include/openssl/asn1.h ../include/openssl/bio.h @@ -378,11 +385,12 @@ ssltest.o: ../include/openssl/md2.h ../include/openssl/md5.h ssltest.o: ../include/openssl/mdc2.h ../include/openssl/objects.h ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h ssltest.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssltest.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h -ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h -ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h -ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -ssltest.o: ../include/openssl/stack.h ../include/openssl/tls1.h -ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssltest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +ssltest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h +ssltest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h +ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h +ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ssltest.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssltest.o: ../include/openssl/x509_vfy.h diff --git a/lib/libssl/test/dsa-ca.pem b/lib/libssl/test/dsa-ca.pem index 9eb08f3ddd4..e69de29bb2d 100644 --- a/lib/libssl/test/dsa-ca.pem +++ b/lib/libssl/test/dsa-ca.pem @@ -1,43 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C5B6C7CC9E1FE2C0 - -svCXBcBRhMuU22UXOfiKZA+thmz6KYXpt1Yg5Rd+TYQcQ1MdvNy0B0tkP1SxzDq0 -Xh1eMeTML9/9/0rKakgNXXXbpi5RB8t6BmwRSyej89F7nn1mtR3qzoyPRpp15SDl -Tn67C+2v+HDF3MFk88hiNCYkNbcmi7TWvChsl8N1r7wdZwtIox56yXdgxw6ZIpa/ -par0oUCzN7fiavPgCWz1kfPNSaBQSdxwH7TZi5tMHAr0J3C7a7QRnZfE09R59Uqr -zslrq+ndIw1BZAxoY0SlBu+iFOVaBVlwToC4AsHkv7j7l8ITtr7f42YbBa44D9TO -uOhONmkk/v3Fso4RaOEzdKZC+hnmmzvHs6TiTWm6yzJgSFwyOUK0eGmKEeVxpcH5 -rUOlHOwzen+FFtocZDZAfdFnb7QY7L/boQvyA5A+ZbRG4DUpmBQeQsSaICHM5Rxx -1QaLF413VNPXTLPbW0ilSc2H8x2iZTIVKfd33oSO6NhXPtSYQgfecEF4BvNHY5c4 -HovjT4mckbK95bcBzoCHu43vuSQkmZzdYo/ydSZt6zoPavbBLueTpgSbdXiDi827 -MVqOsYxGCb+kez0FoDSTgw== ------END DSA PRIVATE KEY----- ------BEGIN CERTIFICATE REQUEST----- -MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx -ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew -ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW -sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m -rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk -cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo -bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR -CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB -F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH -vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq -AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u -3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v -AhQfeF5BoMMDbX/kidUVpQ6gadPlZA== ------END CERTIFICATE REQUEST----- ------BEGIN CERTIFICATE----- -MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK -U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww -CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw -CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu -ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE -AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi -ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh -MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD -MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa -C1Q= ------END CERTIFICATE----- - diff --git a/lib/libssl/test/dsa-pca.pem b/lib/libssl/test/dsa-pca.pem index e3641ad47e6..e69de29bb2d 100644 --- a/lib/libssl/test/dsa-pca.pem +++ b/lib/libssl/test/dsa-pca.pem @@ -1,49 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,F80EEEBEEA7386C4 - -GZ9zgFcHOlnhPoiSbVi/yXc9mGoj44A6IveD4UlpSEUt6Xbse3Fr0KHIUyQ3oGnS -mClKoAp/eOTb5Frhto85SzdsxYtac+X1v5XwdzAMy2KowHVk1N8A5jmE2OlkNPNt -of132MNlo2cyIRYaa35PPYBGNCmUm7YcYS8O90YtkrQZZTf4+2C4kllhMcdkQwkr -FWSWC8YOQ7w0LHb4cX1FejHHom9Nd/0PN3vn3UyySvfOqoR7nbXkrpHXmPIr0hxX -RcF0aXcV/CzZ1/nfXWQf4o3+oD0T22SDoVcZY60IzI0oIc3pNCbDV3uKNmgekrFd -qOUJ+QW8oWp7oefRx62iBfIeC8DZunohMXaWAQCU0sLQOR4yEdeUCnzCSywe0bG1 -diD0KYaEe+Yub1BQH4aLsBgDjardgpJRTQLq0DUvw0/QGO1irKTJzegEDNVBKrVn -V4AHOKT1CUKqvGNRP1UnccUDTF6miOAtaj/qpzra7sSk7dkGBvIEeFoAg84kfh9h -hVvF1YyzC9bwZepruoqoUwke/WdNIR5ymOVZ/4Liw0JdIOcq+atbdRX08niqIRkf -dsZrUj4leo3zdefYUQ7w4N2Ns37yDFq7 ------END DSA PRIVATE KEY----- ------BEGIN CERTIFICATE REQUEST----- -MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx -ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB -MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G -lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O -Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR -5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl -aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6 -kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als -QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe -6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ -yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0 -z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB -nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w== ------END CERTIFICATE REQUEST----- ------BEGIN CERTIFICATE----- -MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK -U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww -CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw -CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu -ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww -ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ -R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5 -JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps -BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze -mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO -VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C -uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk -umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A -29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D -AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n -5rKUjNBhSg== ------END CERTIFICATE----- - diff --git a/lib/libssl/test/maketests.com b/lib/libssl/test/maketests.com index e4b052e6887..1246d9a077e 100644 --- a/lib/libssl/test/maketests.com +++ b/lib/libssl/test/maketests.com @@ -147,7 +147,7 @@ $ TEST_FILES = "BNTEST,IDEATEST,MD2TEST,MD5TEST,HMACTEST,"+ - "RC2TEST,RC4TEST,RC5TEST,"+ - "DESTEST,SHATEST,SHA1TEST,MDC2TEST,RMDTEST,"+ - "RANDTEST,DHTEST,"+ - - "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_OAEP_TEST" + "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST" $ TCPIP_PROGRAMS = ",," $ IF COMPILER .EQS. "VAXC" THEN - TCPIP_PROGRAMS = ",SSLTEST," @@ -730,12 +730,36 @@ $! $! Set Up Initial CC Definitions, Possibly With User Ones $! $ CCDEFS = "VMS=1,TCPIP_TYPE_''P4'" +$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM" +$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA" +$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA" +$ IF F$TRNLNM("OPENSSL_NO_DH") THEN CCDEFS = CCDEFS + ",NO_DH" +$ IF F$TRNLNM("OPENSSL_NO_MD2") THEN CCDEFS = CCDEFS + ",NO_MD2" +$ IF F$TRNLNM("OPENSSL_NO_MD5") THEN CCDEFS = CCDEFS + ",NO_MD5" +$ IF F$TRNLNM("OPENSSL_NO_RIPEMD") THEN CCDEFS = CCDEFS + ",NO_RIPEMD" +$ IF F$TRNLNM("OPENSSL_NO_SHA") THEN CCDEFS = CCDEFS + ",NO_SHA" +$ IF F$TRNLNM("OPENSSL_NO_SHA0") THEN CCDEFS = CCDEFS + ",NO_SHA0" +$ IF F$TRNLNM("OPENSSL_NO_SHA1") THEN CCDEFS = CCDEFS + ",NO_SHA1" +$ IF F$TRNLNM("OPENSSL_NO_DES") +$ THEN +$ CCDEFS = CCDEFS + ",NO_DES,NO_MDC2" +$ ELSE +$ IF F$TRNLNM("OPENSSL_NO_MDC2") THEN CCDEFS = CCDEFS + ",NO_MDC2" +$ ENDIF +$ IF F$TRNLNM("OPENSSL_NO_RC2") THEN CCDEFS = CCDEFS + ",NO_RC2" +$ IF F$TRNLNM("OPENSSL_NO_RC4") THEN CCDEFS = CCDEFS + ",NO_RC4" +$ IF F$TRNLNM("OPENSSL_NO_RC5") THEN CCDEFS = CCDEFS + ",NO_RC5" +$ IF F$TRNLNM("OPENSSL_NO_IDEA") THEN CCDEFS = CCDEFS + ",NO_IDEA" +$ IF F$TRNLNM("OPENSSL_NO_BF") THEN CCDEFS = CCDEFS + ",NO_BF" +$ IF F$TRNLNM("OPENSSL_NO_CAST") THEN CCDEFS = CCDEFS + ",NO_CAST" +$ IF F$TRNLNM("OPENSSL_NO_HMAC") THEN CCDEFS = CCDEFS + ",NO_HMAC" +$ IF F$TRNLNM("OPENSSL_NO_SSL2") THEN CCDEFS = CCDEFS + ",NO_SSL2" $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS $ CCEXTRAFLAGS = "" $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS -$ CCDISABLEWARNINGS = "" +$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - - CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS + CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! $! Check To See If The User Entered A Valid Paramter. $! diff --git a/lib/libssl/test/rsa_test.c b/lib/libssl/test/rsa_test.c new file mode 100644 index 00000000000..e5ae0c1f698 --- /dev/null +++ b/lib/libssl/test/rsa_test.c @@ -0,0 +1,314 @@ +/* test vectors from p1ovect1.txt */ + +#include +#include + +#include "openssl/e_os.h" + +#include +#include +#include +#ifdef NO_RSA +int main(int argc, char *argv[]) +{ + printf("No RSA support\n"); + return(0); +} +#else +#include + +#define SetKey \ + key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \ + key->e = BN_bin2bn(e, sizeof(e)-1, key->e); \ + key->d = BN_bin2bn(d, sizeof(d)-1, key->d); \ + key->p = BN_bin2bn(p, sizeof(p)-1, key->p); \ + key->q = BN_bin2bn(q, sizeof(q)-1, key->q); \ + key->dmp1 = BN_bin2bn(dmp1, sizeof(dmp1)-1, key->dmp1); \ + key->dmq1 = BN_bin2bn(dmq1, sizeof(dmq1)-1, key->dmq1); \ + key->iqmp = BN_bin2bn(iqmp, sizeof(iqmp)-1, key->iqmp); \ + memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \ + return (sizeof(ctext_ex) - 1); + +static int key1(RSA *key, unsigned char *c) + { + static unsigned char n[] = +"\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F" +"\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5" +"\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93" +"\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1" +"\xF5"; + + static unsigned char e[] = "\x11"; + + static unsigned char d[] = +"\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44" +"\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64" +"\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9" +"\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"; + + static unsigned char p[] = +"\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" +"\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12" +"\x0D"; + + static unsigned char q[] = +"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" +"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" +"\x89"; + + static unsigned char dmp1[] = +"\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF" +"\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05"; + + static unsigned char dmq1[] = +"\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99" +"\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D" +"\x51"; + + static unsigned char iqmp[] = +"\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8" +"\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26"; + + static unsigned char ctext_ex[] = +"\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89" +"\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52" +"\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44" +"\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2"; + + SetKey; + } + +static int key2(RSA *key, unsigned char *c) + { + static unsigned char n[] = +"\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8" +"\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26" +"\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8" +"\x34\x77\xCF"; + + static unsigned char e[] = "\x3"; + + static unsigned char d[] = +"\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2" +"\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41" +"\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21" +"\xE5\xEB"; + + static unsigned char p[] = +"\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92" +"\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91"; + + static unsigned char q[] = +"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" +"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5F"; + + static unsigned char dmp1[] = +"\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61" +"\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B"; + + static unsigned char dmq1[] = +"\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90" +"\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F"; + + static unsigned char iqmp[] = +"\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13" +"\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D"; + + static unsigned char ctext_ex[] = +"\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a" +"\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4" +"\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52" +"\x62\x51"; + + SetKey; + } + +static int key3(RSA *key, unsigned char *c) + { + static unsigned char n[] = +"\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71" +"\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5" +"\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD" +"\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80" +"\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25" +"\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39" +"\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68" +"\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD" +"\xCB"; + + static unsigned char e[] = "\x11"; + + static unsigned char d[] = +"\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD" +"\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41" +"\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69" +"\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA" +"\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94" +"\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A" +"\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94" +"\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3" +"\xC1"; + + static unsigned char p[] = +"\x00\xEE\xCF\xAE\x81\xB1\xB9\xB3\xC9\x08\x81\x0B\x10\xA1\xB5\x60" +"\x01\x99\xEB\x9F\x44\xAE\xF4\xFD\xA4\x93\xB8\x1A\x9E\x3D\x84\xF6" +"\x32\x12\x4E\xF0\x23\x6E\x5D\x1E\x3B\x7E\x28\xFA\xE7\xAA\x04\x0A" +"\x2D\x5B\x25\x21\x76\x45\x9D\x1F\x39\x75\x41\xBA\x2A\x58\xFB\x65" +"\x99"; + + static unsigned char q[] = +"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" +"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" +"\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" +"\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x15" +"\x03"; + + static unsigned char dmp1[] = +"\x54\x49\x4C\xA6\x3E\xBA\x03\x37\xE4\xE2\x40\x23\xFC\xD6\x9A\x5A" +"\xEB\x07\xDD\xDC\x01\x83\xA4\xD0\xAC\x9B\x54\xB0\x51\xF2\xB1\x3E" +"\xD9\x49\x09\x75\xEA\xB7\x74\x14\xFF\x59\xC1\xF7\x69\x2E\x9A\x2E" +"\x20\x2B\x38\xFC\x91\x0A\x47\x41\x74\xAD\xC9\x3C\x1F\x67\xC9\x81"; + + static unsigned char dmq1[] = +"\x47\x1E\x02\x90\xFF\x0A\xF0\x75\x03\x51\xB7\xF8\x78\x86\x4C\xA9" +"\x61\xAD\xBD\x3A\x8A\x7E\x99\x1C\x5C\x05\x56\xA9\x4C\x31\x46\xA7" +"\xF9\x80\x3F\x8F\x6F\x8A\xE3\x42\xE9\x31\xFD\x8A\xE4\x7A\x22\x0D" +"\x1B\x99\xA4\x95\x84\x98\x07\xFE\x39\xF9\x24\x5A\x98\x36\xDA\x3D"; + + static unsigned char iqmp[] = +"\x00\xB0\x6C\x4F\xDA\xBB\x63\x01\x19\x8D\x26\x5B\xDB\xAE\x94\x23" +"\xB3\x80\xF2\x71\xF7\x34\x53\x88\x50\x93\x07\x7F\xCD\x39\xE2\x11" +"\x9F\xC9\x86\x32\x15\x4F\x58\x83\xB1\x67\xA9\x67\xBF\x40\x2B\x4E" +"\x9E\x2E\x0F\x96\x56\xE6\x98\xEA\x36\x66\xED\xFB\x25\x79\x80\x39" +"\xF7"; + + static unsigned char ctext_ex[] = +"\xb8\x24\x6b\x56\xa6\xed\x58\x81\xae\xb5\x85\xd9\xa2\x5b\x2a\xd7" +"\x90\xc4\x17\xe0\x80\x68\x1b\xf1\xac\x2b\xc3\xde\xb6\x9d\x8b\xce" +"\xf0\xc4\x36\x6f\xec\x40\x0a\xf0\x52\xa7\x2e\x9b\x0e\xff\xb5\xb3" +"\xf2\xf1\x92\xdb\xea\xca\x03\xc1\x27\x40\x05\x71\x13\xbf\x1f\x06" +"\x69\xac\x22\xe9\xf3\xa7\x85\x2e\x3c\x15\xd9\x13\xca\xb0\xb8\x86" +"\x3a\x95\xc9\x92\x94\xce\x86\x74\x21\x49\x54\x61\x03\x46\xf4\xd4" +"\x74\xb2\x6f\x7c\x48\xb4\x2e\xe6\x8e\x1f\x57\x2a\x1f\xc4\x02\x6a" +"\xc4\x56\xb4\xf5\x9f\x7b\x62\x1e\xa1\xb9\xd8\x8f\x64\x20\x2f\xb1"; + + SetKey; + } + +static int pad_unknown(void) +{ + unsigned long l; + while ((l = ERR_get_error()) != 0) + if (ERR_GET_REASON(l) == RSA_R_UNKNOWN_PADDING_TYPE) + return(1); + return(0); +} + +static const char rnd_seed[] = "string to make the random number generator think it has entropy"; + +int main(int argc, char *argv[]) + { + int err=0; + int v; + RSA *key; + unsigned char ptext[256]; + unsigned char ctext[256]; + static unsigned char ptext_ex[] = "\x54\x85\x9b\x34\x2c\x49\xea\x2a"; + unsigned char ctext_ex[256]; + int plen; + int clen = 0; + int num; + + RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */ + + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + plen = sizeof(ptext_ex) - 1; + + for (v = 0; v < 3; v++) + { + key = RSA_new(); + switch (v) { + case 0: + clen = key1(key, ctext_ex); + break; + case 1: + clen = key2(key, ctext_ex); + break; + case 2: + clen = key3(key, ctext_ex); + break; + } + + num = RSA_public_encrypt(plen, ptext_ex, ctext, key, + RSA_PKCS1_PADDING); + if (num != clen) + { + printf("PKCS#1 v1.5 encryption failed!\n"); + err=1; + goto oaep; + } + + num = RSA_private_decrypt(num, ctext, ptext, key, + RSA_PKCS1_PADDING); + if (num != plen || memcmp(ptext, ptext_ex, num) != 0) + { + printf("PKCS#1 v1.5 decryption failed!\n"); + err=1; + } + else + printf("PKCS #1 v1.5 encryption/decryption ok\n"); + + oaep: + ERR_clear_error(); + num = RSA_public_encrypt(plen, ptext_ex, ctext, key, + RSA_PKCS1_OAEP_PADDING); + if (num == -1 && pad_unknown()) + { + printf("No OAEP support\n"); + goto next; + } + if (num != clen) + { + printf("OAEP encryption failed!\n"); + err=1; + goto next; + } + + num = RSA_private_decrypt(num, ctext, ptext, key, + RSA_PKCS1_OAEP_PADDING); + if (num != plen || memcmp(ptext, ptext_ex, num) != 0) + { + printf("OAEP decryption (encrypted data) failed!\n"); + err=1; + } + else if (memcmp(ctext, ctext_ex, num) == 0) + { + printf("OAEP test vector %d passed!\n", v); + goto next; + } + + /* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT). + Try decrypting ctext_ex */ + + num = RSA_private_decrypt(clen, ctext_ex, ptext, key, + RSA_PKCS1_OAEP_PADDING); + + if (num != plen || memcmp(ptext, ptext_ex, num) != 0) + { + printf("OAEP decryption (test vector data) failed!\n"); + err=1; + } + else + printf("OAEP encryption/decryption ok\n"); + next: + RSA_free(key); + } + + ERR_remove_state(0); + + CRYPTO_mem_leaks_fp(stdout); + + return err; + } +#endif diff --git a/lib/libssl/test/tcrl.com b/lib/libssl/test/tcrl.com index cef21467bb6..2e6ab2814d8 100644 --- a/lib/libssl/test/tcrl.com +++ b/lib/libssl/test/tcrl.com @@ -10,6 +10,9 @@ $ t := testcrl.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing CRL conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -52,27 +55,27 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: fff.p ff.p2 +$! backup/compare fff.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$! difference/output=nl: f.t ff.t1 +$! backup/compare f.t ff.t1 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t2 +$! backup/compare f.t ff.t2 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t3 +$! backup/compare f.t ff.t3 $! if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.p ff.p2 +$! backup/compare f.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/testca.com b/lib/libssl/test/testca.com index ea75479cd5a..c670f2bf5f7 100644 --- a/lib/libssl/test/testca.com +++ b/lib/libssl/test/testca.com @@ -40,7 +40,9 @@ $ $ set noon $ call deltree [.demoCA]*.* $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* -$ delete demoCA.dir;*,newcert.pem;*,newreq.pem;* +$ delete demoCA.dir;* +$ if f$search("newcert.pem") .nes. "" then delete newcert.pem;* +$ if f$search("newcert.pem") .nes. "" then delete newreq.pem;* $ set on $! #usage: CA -newcert|-newreq|-newca|-sign|-verify $ diff --git a/lib/libssl/test/testenc.com b/lib/libssl/test/testenc.com index 0756e8badaa..3b66f2e0d06 100644 --- a/lib/libssl/test/testenc.com +++ b/lib/libssl/test/testenc.com @@ -8,19 +8,23 @@ $ testsrc := makefile.ssl $ test := p.txt $ cmd := mcr 'exe_dir'openssl $ +$ if f$search(test) .nes. "" then delete 'test';* $ copy 'testsrc' 'test' $ +$ if f$search(test+"-cipher") .nes. "" then delete 'test'-cipher;* +$ if f$search(test+"-clear") .nes. "" then delete 'test'-clear;* +$ $ write sys$output "cat" $ 'cmd' enc -in 'test' -out 'test'-cipher $ 'cmd' enc -in 'test'-cipher -out 'test'-clear -$ difference/output=nl: 'test' 'test'-clear +$ backup/compare 'test' 'test'-clear $ if $severity .ne. 1 then exit 3 $ delete 'test'-cipher;*,'test'-clear;* $ $ write sys$output "base64" $ 'cmd' enc -a -e -in 'test' -out 'test'-cipher $ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear -$ difference/output=nl: 'test' 'test'-clear +$ backup/compare 'test' 'test'-clear $ if $severity .ne. 1 then exit 3 $ delete 'test'-cipher;*,'test'-clear;* $ @@ -30,16 +34,22 @@ $ open/read f 'test'-cipher-commands $ loop_cipher_commands: $ read/end=loop_cipher_commands_end f i $ write sys$output i +$ +$ if f$search(test+"-"+i+"-cipher") .nes. "" then - + delete 'test'-'i'-cipher;* +$ if f$search(test+"-"+i+"-clear") .nes. "" then - + delete 'test'-'i'-clear;* +$ $ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher $ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear -$ difference/output=nl: 'test' 'test'-'i'-clear +$ backup/compare 'test' 'test'-'i'-clear $ if $severity .ne. 1 then exit 3 $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* $ $ write sys$output i," base64" $ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher $ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear -$ difference/output=nl: 'test' 'test'-'i'-clear +$ backup/compare 'test' 'test'-'i'-clear $ if $severity .ne. 1 then exit 3 $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* $ diff --git a/lib/libssl/test/testgen b/lib/libssl/test/testgen index 3534f5821f0..c5f61b582be 100644 --- a/lib/libssl/test/testgen +++ b/lib/libssl/test/testgen @@ -15,6 +15,8 @@ echo "There should be a 2 sequences of .'s and some +'s." echo "There should not be more that at most 80 per line" echo "This could take some time." +echo "string to make the random number generator think it has entropy" >> ./.rnd + ../apps/openssl req -config test.cnf -new -out testreq.pem if [ $? != 0 ]; then echo problems creating request diff --git a/lib/libssl/test/testgen.com b/lib/libssl/test/testgen.com index ec302f524a4..0e9029371a3 100644 --- a/lib/libssl/test/testgen.com +++ b/lib/libssl/test/testgen.com @@ -20,6 +20,11 @@ $ write sys$output "There should be a 2 sequences of .'s and some +'s." $ write sys$output "There should not be more that at most 80 per line" $ write sys$output "This could take some time." $ +$ append/new nl: .rnd +$ open/append random_file .rnd +$ write random_file "string to make the random number generator think it has entropy" +$ close random_file +$ $ mcr 'exe_dir'openssl req -config test.cnf -new -out testreq.pem $ if $severity .ne. 1 $ then diff --git a/lib/libssl/test/tests.com b/lib/libssl/test/tests.com index 147b8aa8389..040dafab8dc 100644 --- a/lib/libssl/test/tests.com +++ b/lib/libssl/test/tests.com @@ -20,9 +20,9 @@ $ tests = p1 $ else $ tests := - test_des,test_idea,test_sha,test_md5,test_hmac,test_md2,test_mdc2,- - test_rc2,test_rc4,test_rc5,test_bf,test_cast,- + test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,- test_rand,test_bn,test_enc,test_x509,test_rsa,test_crl,test_sid,- - test_reqgen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- + test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- test_ss,test_ssl,test_ca $ endif $ tests = f$edit(tests,"COLLAPSE") @@ -48,7 +48,7 @@ $ DHTEST := dhtest $ DSATEST := dsatest $ METHTEST := methtest $ SSLTEST := ssltest -$ RSATEST := rsa_oaep_test +$ RSATEST := rsa_test $ $ tests_i = 0 $ loop_tests: @@ -151,9 +151,7 @@ RECORD $ create/fdl=bntest-vms.fdl bntest-vms.sh $ open/append foo bntest-vms.sh $ type/output=foo: sys$input: -<< __FOO__ bc | awk '{ \ -if ($$0 != "0") {print "error"; exit(1); } \ -if (((NR+1)%64) == 0) print NR+1," tests done"; }' +<< __FOO__ bc | perl -e 'while () {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} print STDERR "."; $i++;} print STDERR "\n$i tests passed\n"' $ define/user sys$output bntest-vms.tmp $ mcr 'texe_dir''bntest' $ copy bntest-vms.tmp foo: @@ -173,14 +171,14 @@ $ write sys$output "There are definitly a few expired certificates" $ @tverify.com $ goto loop_tests $ test_dh: -$ write sys$output "Generate as set of DH parameters" +$ write sys$output "Generate a set of DH parameters" $ mcr 'texe_dir''dhtest' $ goto loop_tests $ test_dsa: -$ write sys$output "Generate as set of DSA parameters" +$ write sys$output "Generate a set of DSA parameters" $ mcr 'texe_dir''dsatest' $ goto loop_tests -$ test_reqgen: +$ test_gen: $ write sys$output "Generate and verify a certificate request" $ @testgen.com $ goto loop_tests diff --git a/lib/libssl/test/testssl b/lib/libssl/test/testssl index 255ae5e9768..a88e290c577 100644 --- a/lib/libssl/test/testssl +++ b/lib/libssl/test/testssl @@ -63,6 +63,12 @@ echo test sslv3 with both client and server authentication via BIO pair echo test sslv2/sslv3 via BIO pair ./ssltest || exit 1 +echo test sslv2/sslv3 w/o DHE via BIO pair +./ssltest -bio_pair -no_dhe || exit 1 + +echo test sslv2/sslv3 with 1024bit DHE +./ssltest -bio_pair -dhe1024 -v || exit 1 + echo test sslv2/sslv3 with server authentication ./ssltest -bio_pair -server_auth -CApath ../certs || exit 1 diff --git a/lib/libssl/test/testssl.com b/lib/libssl/test/testssl.com index 93a9aef8026..0b4b0a0ad3c 100644 --- a/lib/libssl/test/testssl.com +++ b/lib/libssl/test/testssl.com @@ -58,6 +58,10 @@ $ write sys$output "test sslv2 via BIO pair" $ mcr 'exe_dir'ssltest -bio_pair -ssl2 $ if $severity .ne. 1 then goto exit3 $ +$ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" +$ mcr 'exe_dir'ssltest -bio_pair -dhe1024 -v +$ if $severity .ne. 1 then goto exit3 +$ $ write sys$output "test sslv2 with server authentication via BIO pair" $ mcr 'exe_dir'ssltest -bio_pair -ssl2 -server_auth "-CAfile" certs.tmp $ if $severity .ne. 1 then goto exit3 @@ -90,6 +94,10 @@ $ write sys$output "test sslv2/sslv3 via BIO pair" $ mcr 'exe_dir'ssltest $ if $severity .ne. 1 then goto exit3 $ +$ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" +$ mcr 'exe_dir'ssltest -bio_pair -no_dhe +$ if $severity .ne. 1 then goto exit3 +$ $ write sys$output "test sslv2/sslv3 with server authentication" $ mcr 'exe_dir'ssltest -bio_pair -server_auth "-CAfile" certs.tmp $ if $severity .ne. 1 then goto exit3 diff --git a/lib/libssl/test/tpkcs7.com b/lib/libssl/test/tpkcs7.com index 5ed920ac345..9e345937c6e 100644 --- a/lib/libssl/test/tpkcs7.com +++ b/lib/libssl/test/tpkcs7.com @@ -10,6 +10,9 @@ $ t := testp7.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing PKCS7 conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -34,16 +37,16 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/tpkcs7d.com b/lib/libssl/test/tpkcs7d.com index 08d33eaa690..7d4f8794a4c 100644 --- a/lib/libssl/test/tpkcs7d.com +++ b/lib/libssl/test/tpkcs7d.com @@ -10,6 +10,9 @@ $ t := pkcs7-1.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing PKCS7 conversions (2)" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -34,9 +37,9 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/treq.com b/lib/libssl/test/treq.com index 9eb1d26f6e3..22c22c3aa9e 100644 --- a/lib/libssl/test/treq.com +++ b/lib/libssl/test/treq.com @@ -10,6 +10,9 @@ $ t := testreq.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing req conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -52,27 +55,27 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: fff.p ff.p2 +$! backup/compare fff.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$! difference/output=nl: f.t ff.t1 +$! backup/compare f.t ff.t1 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t2 +$! backup/compare f.t ff.t2 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t3 +$! backup/compare f.t ff.t3 $! if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.p ff.p2 +$! backup/compare f.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/trsa.com b/lib/libssl/test/trsa.com index 9c9083d02b8..28add5eefd0 100644 --- a/lib/libssl/test/trsa.com +++ b/lib/libssl/test/trsa.com @@ -10,6 +10,9 @@ $ t := testrsa.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing RSA conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -52,27 +55,27 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: fff.p ff.p2 +$! backup/compare fff.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$! difference/output=nl: f.t ff.t1 +$! backup/compare f.t ff.t1 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t2 +$! backup/compare f.t ff.t2 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t3 +$! backup/compare f.t ff.t3 $! if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.p ff.p2 +$! backup/compare f.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/tsid.com b/lib/libssl/test/tsid.com index 28d83e5c4ed..bde23f9bb97 100644 --- a/lib/libssl/test/tsid.com +++ b/lib/libssl/test/tsid.com @@ -10,6 +10,9 @@ $ t := testsid.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing session-id conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -52,27 +55,27 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: fff.p ff.p2 +$! backup/compare fff.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$! difference/output=nl: f.t ff.t1 +$! backup/compare f.t ff.t1 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t2 +$! backup/compare f.t ff.t2 $! if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.t ff.t3 +$! backup/compare f.t ff.t3 $! if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$! difference/output=nl: f.p ff.p2 +$! backup/compare f.p ff.p2 $! if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* diff --git a/lib/libssl/test/tx509.com b/lib/libssl/test/tx509.com index bbcf0a384b3..985969c566f 100644 --- a/lib/libssl/test/tx509.com +++ b/lib/libssl/test/tx509.com @@ -10,6 +10,9 @@ $ t := testx509.pem $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing X509 conversions" +$ if f$search("fff.*") .nes "" then delete fff.*;* +$ if f$search("ff.*") .nes "" then delete ff.*;* +$ if f$search("f.*") .nes "" then delete f.*;* $ copy 't' fff.p $ $ write sys$output "p -> d" @@ -52,27 +55,27 @@ $ write sys$output "p -> p" $ 'cmd' -in f.p -inform p -outform p -out ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: fff.p f.p +$ backup/compare fff.p f.p $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p1 +$ backup/compare fff.p ff.p1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p2 +$ backup/compare fff.p ff.p2 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: fff.p ff.p3 +$ backup/compare fff.p ff.p3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.n ff.n1 +$ backup/compare f.n ff.n1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.n ff.n2 +$ backup/compare f.n ff.n2 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.n ff.n3 +$ backup/compare f.n ff.n3 $ if $severity .ne. 1 then exit 3 $ -$ difference/output=nl: f.p ff.p1 +$ backup/compare f.p ff.p1 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p2 +$ backup/compare f.p ff.p2 $ if $severity .ne. 1 then exit 3 -$ difference/output=nl: f.p ff.p3 +$ backup/compare f.p ff.p3 $ if $severity .ne. 1 then exit 3 $ $ delete f.*;*,ff.*;*,fff.*;* -- cgit v1.2.3