diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:52:47 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:52:47 +0000 |
commit | d02b48c63a58ea4367a0e905979f140b7d090f86 (patch) | |
tree | 504f62ed3d84799f785b9cd9fab255a21b0e1b0e /test |
Import of old SSLeay release: SSLeay 0.8.1b
Diffstat (limited to 'test')
-rw-r--r-- | test/CAss.cnf | 25 | ||||
-rw-r--r-- | test/Makefile.ssl | 263 | ||||
-rw-r--r-- | test/Uss.cnf | 28 | ||||
-rw-r--r-- | test/certCA.srl | 1 | ||||
-rw-r--r-- | test/dsa-ca.pem | 43 | ||||
-rw-r--r-- | test/dsa-pca.pem | 49 | ||||
-rw-r--r-- | test/methtest.c | 105 | ||||
-rw-r--r-- | test/pkcs7-1.pem | 15 | ||||
-rw-r--r-- | test/pkcs7.pem | 54 | ||||
-rw-r--r-- | test/tcrl | 81 | ||||
-rw-r--r-- | test/test.cnf | 88 | ||||
-rw-r--r-- | test/test.txt | 31 | ||||
-rw-r--r-- | test/testca | 44 | ||||
-rw-r--r-- | test/testcrl.pem | 16 | ||||
-rw-r--r-- | test/testenc | 61 | ||||
-rw-r--r-- | test/testgen | 30 | ||||
-rw-r--r-- | test/testkey.pem | 9 | ||||
-rw-r--r-- | test/testp7.pem | 46 | ||||
-rw-r--r-- | test/testreq.pem | 9 | ||||
-rw-r--r-- | test/testreq2.pem | 7 | ||||
-rw-r--r-- | test/testrsa.pem | 9 | ||||
-rw-r--r-- | test/testsid.pem | 12 | ||||
-rw-r--r-- | test/testss | 89 | ||||
-rw-r--r-- | test/testssl | 40 | ||||
-rw-r--r-- | test/testx509.pem | 10 | ||||
-rw-r--r-- | test/tpkcs7 | 51 | ||||
-rw-r--r-- | test/tpkcs7d | 44 | ||||
-rw-r--r-- | test/treq | 81 | ||||
-rw-r--r-- | test/trsa | 81 | ||||
-rw-r--r-- | test/tsid | 81 | ||||
-rw-r--r-- | test/tx509 | 81 | ||||
-rw-r--r-- | test/v3-cert1.pem | 16 | ||||
-rw-r--r-- | test/v3-cert2.pem | 16 |
33 files changed, 1616 insertions, 0 deletions
diff --git a/test/CAss.cnf b/test/CAss.cnf new file mode 100644 index 0000000000..b941b7ae15 --- /dev/null +++ b/test/CAss.cnf @@ -0,0 +1,25 @@ +# +# SSLeay example configuration file. +# This is mostly being used for generation of certificate requests. +# + +RANDFILE = ./.rnd + +#################################################################### +[ req ] +default_bits = 512 +default_keyfile = keySS.pem +distinguished_name = req_distinguished_name +encrypt_rsa_key = no +default_md = sha1 + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = AU +countryName_value = AU + +organizationName = Organization Name (eg, company) +organizationName_value = Dodgy Brothers + +commonName = Common Name (eg, YOUR name) +commonName_value = Dodgy CA diff --git a/test/Makefile.ssl b/test/Makefile.ssl new file mode 100644 index 0000000000..ee48d5493d --- /dev/null +++ b/test/Makefile.ssl @@ -0,0 +1,263 @@ +# +# test/Makefile.ssl +# + +DIR= test +TOP= .. +CC= cc +INCLUDES= -I../include +CFLAG= -g +INSTALLTOP= /usr/local/ssl +MAKEFILE= Makefile.ssl +MAKE= make -f $(MAKEFILE) +MAKEDEPEND= makedepend -f$(MAKEFILE) + +PEX_LIBS= +EX_LIBS= -lnsl -lsocket + +CFLAGS= $(INCLUDES) $(CFLAG) + +GENERAL=Makefile.ssl + +DLIBCRYPTO= ../libcrypto.a +DLIBSSL= ../libssl.a +LIBCRYPTO= -L.. -lcrypto +LIBSSL= -L.. -lssl + +BNTEST= bntest +EXPTEST= exptest +IDEATEST= ideatest +SHATEST= shatest +SHA1TEST= sha1test +MDC2TEST= mdc2test +MD2TEST= md2test +MD5TEST= md5test +RC4TEST= rc4test +RC2TEST= rc2test +BFTEST= bftest +DESTEST= destest +RANDTEST= randtest +DHTEST= dhtest +DSATEST= dsatest +METHTEST= methtest +SSLTEST= ssltest + +EXE= $(BNTEST) $(IDEATEST) $(MD2TEST) $(MD5TEST) $(RC4TEST) \ + $(DESTEST) $(SHATEST) $(SHA1TEST) $(MDC2TEST) $(RANDTEST) $(DHTEST) \ + $(RC2TEST) $(BFTEST) $(SSLTEST) $(EXPTEST) $(DSATEST) + +# $(METHTEST) + +OBJ= $(BNTEST).o $(IDEATEST).o $(MD2TEST).o $(MD5TEST).o $(RC4TEST).o \ + $(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(MDC2TEST).o \ + $(RANDTEST).o $(DHTEST).o \ + $(RC2TEST).o $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o +SRC= $(BNTEST).c $(IDEATEST).c $(MD2TEST).c $(MD5TEST).c $(RC4TEST).c \ + $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c \ + $(RANDTEST).c $(DHTEST).c \ + $(RC2TEST).c $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c + +EXHEADER= +HEADER= $(EXHEADER) + +ALL= $(GENERAL) $(SRC) $(HEADER) + +top: + (cd ..; $(MAKE) DIRS=$(DIR) all) + +all: exe + +exe: $(EXE) + +files: + perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO + +links: + /bin/rm -f Makefile + $(TOP)/util/point.sh Makefile.ssl Makefile ; + +errors: + +install: + +tags: + ctags $(SRC) + +tests: exe apps \ + test_des test_idea test_sha test_md5 test_md2 test_mdc2 \ + test_rc2 test_rc4 test_bf \ + test_rand test_enc test_x509 test_rsa test_crl test_sid test_req \ + test_pkcs7 test_bn test_verify test_dh test_dsa test_reqgen \ + test_ss test_ssl test_ca + +apps: + @(cd ../apps; $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' all) + +test_des: + ./$(DESTEST) + +test_idea: + ./$(IDEATEST) + +test_sha: + ./$(SHATEST) + ./$(SHA1TEST) + +test_mdc2: + ./$(MDC2TEST) + +test_md5: + ./$(MD5TEST) + +test_md2: + ./$(MD2TEST) + +test_rc2: + ./$(RC2TEST) + +test_bf: + ./$(BFTEST) + +test_rc4: + ./$(RC4TEST) + +test_rand: + ./$(RANDTEST) + +test_enc: + @sh ./testenc + +test_x509: + echo test normal x509v1 certificate + sh ./tx509 2>/dev/null + echo test first x509v3 certificate + sh ./tx509 v3-cert1.pem 2>/dev/null + echo test second x509v3 certificate + sh ./tx509 v3-cert2.pem 2>/dev/null + +test_rsa: + @sh ./trsa 2>/dev/null + +test_crl: + @sh ./tcrl 2>/dev/null + +test_sid: + @sh ./tsid 2>/dev/null + +test_req: + @sh ./treq 2>/dev/null + @sh ./treq testreq2.pem 2>/dev/null + +test_pkcs7: + @sh ./tpkcs7 2>/dev/null + @sh ./tpkcs7d 2>/dev/null + +test_bn: + @echo 'test a^b%c implementations' + ./$(EXPTEST) + @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"; }' + +test_verify: + @echo "The following command should have some OK's and some failures" + @echo "There are definitly a few expired certificates" + ../apps/ssleay verify -CApath ../certs ../certs/*.pem + +test_dh: + @echo "Generate as set of DH parameters" + ./$(DHTEST) + +test_dsa: + @echo "Generate as set of DSA parameters" + ./$(DSATEST) + +test_reqgen: + @echo "Generate and verify a certificate request" + @sh ./testgen + +test_ss: + @echo "Generate and certify a test certificate" + @sh ./testss + +test_ssl: + @echo "test SSL protocol" + @sh ./testssl + +test_ca: + @echo "Generate and certify a test certificate via the 'ca' program" + @sh ./testca + +lint: + lint -DLINT $(INCLUDES) $(SRC)>fluff + +depend: + $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(SRC) + +dclean: + perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new + mv -f Makefile.new $(MAKEFILE) + +clean: + /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss log + +$(DLIBSSL): + (cd ../ssl; $(MAKE)) + +$(DLIBCRYPTO): + (cd ../crypto; $(MAKE)) + +$(BNTEST): $(BNTEST).o $(DLIBCRYPTO) + $(CC) -o $(BNTEST) $(CFLAGS) $(BNTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(EXPTEST): $(EXPTEST).o $(DLIBCRYPTO) + $(CC) -o $(EXPTEST) $(CFLAGS) $(EXPTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(IDEATEST): $(IDEATEST).o $(DLIBCRYPTO) + $(CC) -o $(IDEATEST) $(CFLAGS) $(IDEATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(MD2TEST): $(MD2TEST).o $(DLIBCRYPTO) + $(CC) -o $(MD2TEST) $(CFLAGS) $(MD2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(SHATEST): $(SHATEST).o $(DLIBCRYPTO) + $(CC) -o $(SHATEST) $(CFLAGS) $(SHATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(SHA1TEST): $(SHA1TEST).o $(DLIBCRYPTO) + $(CC) -o $(SHA1TEST) $(CFLAGS) $(SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(MDC2TEST): $(MDC2TEST).o $(DLIBCRYPTO) + $(CC) -o $(MDC2TEST) $(CFLAGS) $(MDC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(MD5TEST): $(MD5TEST).o $(DLIBCRYPTO) + $(CC) -o $(MD5TEST) $(CFLAGS) $(MD5TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(RC2TEST): $(RC2TEST).o $(DLIBCRYPTO) + $(CC) -o $(RC2TEST) $(CFLAGS) $(RC2TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(BFTEST): $(BFTEST).o $(DLIBCRYPTO) + $(CC) -o $(BFTEST) $(CFLAGS) $(BFTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + + +$(RC4TEST): $(RC4TEST).o $(DLIBCRYPTO) + $(CC) -o $(RC4TEST) $(CFLAGS) $(RC4TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(DESTEST): $(DESTEST).o $(DLIBCRYPTO) + $(CC) -o $(DESTEST) $(CFLAGS) $(DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO) + $(CC) -o $(RANDTEST) $(CFLAGS) $(RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(DHTEST): $(DHTEST).o $(DLIBCRYPTO) + $(CC) -o $(DHTEST) $(CFLAGS) $(DHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(DSATEST): $(DSATEST).o $(DLIBCRYPTO) + $(CC) -o $(DSATEST) $(CFLAGS) $(DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(METHTEST): $(METHTEST).o $(DLIBCRYPTO) + $(CC) -o $(METHTEST) $(CFLAGS) $(METHTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + +$(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) + $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS) + +# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/test/Uss.cnf b/test/Uss.cnf new file mode 100644 index 0000000000..c89692d519 --- /dev/null +++ b/test/Uss.cnf @@ -0,0 +1,28 @@ +# +# SSLeay example configuration file. +# This is mostly being used for generation of certificate requests. +# + +RANDFILE = ./.rnd + +#################################################################### +[ req ] +default_bits = 512 +default_keyfile = keySS.pem +distinguished_name = req_distinguished_name +encrypt_rsa_key = no +default_md = md2 + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = AU +countryName_value = AU + +organizationName = Organization Name (eg, company) +organizationName_value = Dodgy Brothers + +0.commonName = Common Name (eg, YOUR name) +0.commonName_value = Brother 1 + +1.commonName = Common Name (eg, YOUR name) +1.commonName_value = Brother 2 diff --git a/test/certCA.srl b/test/certCA.srl new file mode 100644 index 0000000000..f5c89552bd --- /dev/null +++ b/test/certCA.srl @@ -0,0 +1 @@ +32 diff --git a/test/dsa-ca.pem b/test/dsa-ca.pem new file mode 100644 index 0000000000..9eb08f3ddd --- /dev/null +++ b/test/dsa-ca.pem @@ -0,0 +1,43 @@ +-----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 CERTIF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TETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE +AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi +ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh +MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD +MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa +C1Q= +-----END CERTIFICATE----- + diff --git a/test/dsa-pca.pem b/test/dsa-pca.pem new file mode 100644 index 0000000000..e3641ad47e --- /dev/null +++ b/test/dsa-pca.pem @@ -0,0 +1,49 @@ +-----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/test/methtest.c b/test/methtest.c new file mode 100644 index 0000000000..55d1ac7934 --- /dev/null +++ b/test/methtest.c @@ -0,0 +1,105 @@ +/* test/methtest.c */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include <stdio.h> +#include <stdlib.h> +#include "rsa.h" +#include "x509.h" +#include "meth.h" +#include "err.h" + +int main(argc,argv) +int argc; +char *argv[]; + { + METHOD_CTX *top,*tmp1,*tmp2; + + top=METH_new(x509_lookup()); /* get a top level context */ + if (top == NULL) goto err; + + tmp1=METH_new(x509_by_file()); + if (top == NULL) goto err; + METH_arg(tmp1,METH_TYPE_FILE,"cafile1"); + METH_arg(tmp1,METH_TYPE_FILE,"cafile2"); + METH_push(top,METH_X509_CA_BY_SUBJECT,tmp1); + + tmp2=METH_new(x509_by_dir()); + METH_arg(tmp2,METH_TYPE_DIR,"/home/eay/.CAcerts"); + METH_arg(tmp2,METH_TYPE_DIR,"/home/eay/SSLeay/certs"); + METH_arg(tmp2,METH_TYPE_DIR,"/usr/local/ssl/certs"); + METH_push(top,METH_X509_CA_BY_SUBJECT,tmp2); + +/* tmp=METH_new(x509_by_issuer_dir); + METH_arg(tmp,METH_TYPE_DIR,"/home/eay/.mycerts"); + METH_push(top,METH_X509_BY_ISSUER,tmp); + + tmp=METH_new(x509_by_issuer_primary); + METH_arg(tmp,METH_TYPE_FILE,"/home/eay/.mycerts/primary.pem"); + METH_push(top,METH_X509_BY_ISSUER,tmp); +*/ + + METH_init(top); + METH_control(tmp1,METH_CONTROL_DUMP,stdout); + METH_control(tmp2,METH_CONTROL_DUMP,stdout); + exit(0); +err: + ERR_load_crypto_strings(); + ERR_print_errors_fp(stderr); + exit(1); + return(0); + } diff --git a/test/pkcs7-1.pem b/test/pkcs7-1.pem new file mode 100644 index 0000000000..c47b27af88 --- /dev/null +++ b/test/pkcs7-1.pem @@ -0,0 +1,15 @@ +-----BEGIN PKCS7----- +MIICUAYJKoZIhvcNAQcCoIICQTCCAj0CAQExDjAMBggqhkiG9w0CAgUAMCgGCSqG +SIb3DQEHAaAbBBlFdmVyeW9uZSBnZXRzIEZyaWRheSBvZmYuoIIBXjCCAVowggEE +AgQUAAApMA0GCSqGSIb3DQEBAgUAMCwxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRF +eGFtcGxlIE9yZ2FuaXphdGlvbjAeFw05MjA5MDkyMjE4MDZaFw05NDA5MDkyMjE4 +MDVaMEIxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRFeGFtcGxlIE9yZ2FuaXphdGlv +bjEUMBIGA1UEAxMLVGVzdCBVc2VyIDEwWzANBgkqhkiG9w0BAQEFAANKADBHAkAK +ZnkdxpiBaN56t3QZu3+wwAHGJxAnAHUUKULhmo2MUdBTs+N4Kh3l3Fr06+mUaBcB +FKHf5nzcmpr1XWVWILurAgMBAAEwDQYJKoZIhvcNAQECBQADQQBFGqHhqncgSl/N +9XYGnQL3MsJvNnsNV4puZPOakR9Hld8JlDQFEaDR30ogsmp3TMrvdfxpLlTCoZN8 +BxEmnZsWMYGbMIGYAgEBMDQwLDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFEV4YW1w +bGUgT3JnYW5pemF0aW9uAgQUAAApMAwGCCqGSIb3DQICBQAwDQYJKoZIhvcNAQEB +BQAEQAX6aoEvx9+L9PJUJQngPoRuEbnGIL4gCe+0QO+8xmkhaZSsBPNBtX0FIC1C +j7Kie1x339mxW/w9VZNTUDQQweHh +-----END PKCS7----- diff --git a/test/pkcs7.pem b/test/pkcs7.pem new file mode 100644 index 0000000000..d55c60b94e --- /dev/null +++ b/test/pkcs7.pem @@ -0,0 +1,54 @@ + MIAGCSqGSIb3DQEHAqCAMIACAQExADCABgkqhkiG9w0BBwEAAKCAMIIE+DCCBGGg + AwIBAgI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jANBgkqhkiG9w0BAQIFAAOBgQAXsLE4vnsY6sY67QrmWec7iaU2ehzxanEK + /9wKHZNuhlNzk+qGZZw2evxfUe2OaRbYpl8zuZvhK9BHD3ad14OSe9/zx5hOPgP/ + DQXt6R4R8Q/1JheBrolrgbavjvI2wKS8/Psp2prBrkF4T48+AKRmS8Zzh1guxgvP + b+xSu/jH0gAAMYAAAAAAAAAAAA== diff --git a/test/tcrl b/test/tcrl new file mode 100644 index 0000000000..859fba452f --- /dev/null +++ b/test/tcrl @@ -0,0 +1,81 @@ +#!/bin/sh + +PATH=../apps:$PATH +export PATH + +cmd='../apps/ssleay crl' + +if [ "$1"x != "x" ]; then + t=$1 +else + t=testcrl.pem +fi + +echo testing crl conversions +cp $t fff.p + +echo "p -> d" +$cmd -in fff.p -inform p -outform d >f.d +if [ $? != 0 ]; then exit 1; fi +#echo "p -> t" +#$cmd -in fff.p -inform p -outform t >f.t +#if [ $? != 0 ]; then exit 1; fi +echo "p -> p" +$cmd -in fff.p -inform p -outform p >f.p +if [ $? != 0 ]; then exit 1; fi + +echo "d -> d" +$cmd -in f.d -inform d -outform d >ff.d1 +if [ $? != 0 ]; then exit 1; fi +#echo "t -> d" +#$cmd -in f.t -inform t -outform d >ff.d2 +#if [ $? != 0 ]; then exit 1; fi +echo "p -> d" +$cmd -in f.p -inform p -outform d >ff.d3 +if [ $? != 0 ]; then exit 1; fi + +#echo "d -> t" +#$cmd -in f.d -inform d -outform t >ff.t1 +#if [ $? != 0 ]; then exit 1; fi +#echo "t -> t" +#$cmd -in f.t -inform t -outform t >ff.t2 +#if [ $? != 0 ]; then exit 1; fi +#echo "p -> t" +#$cmd -in f.p -inform p -outform t >ff.t3 +#if [ $? != 0 ]; then exit 1; fi + +echo "d -> p" +$cmd -in f.d -inform d -outform p >ff.p1 +if [ $? != 0 ]; then exit 1; fi +#echo "t -> p" +#$cmd -in f.t -inform t -outform p >ff.p2 +#if [ $? != 0 ]; then exit 1; fi +echo "p -> p" +$cmd -in f.p -inform p -outform p >ff.p3 +if [ $? != 0 ]; then exit 1; fi + +cmp fff.p f.p +if [ $? != 0 ]; then exit 1; fi +cmp fff.p ff.p1 +if [ $? != 0 ]; then exit 1; fi +#cmp fff.p ff.p2 +#if [ $? != 0 ]; then exit 1; fi +cmp fff.p ff.p3 +if [ $? != 0 ]; then exit 1; fi + +#cmp f.t ff.t1 +#if [ $? != 0 ]; then exit 1; fi +#cmp f.t ff.t2 +#if [ $? != 0 ]; then exit 1; fi +#cmp f.t ff.t3 +#if [ $? != 0 ]; then exit 1; fi + +cmp f.p ff.p1 +if [ $? != 0 ]; then exit 1; fi +#cmp f.p ff.p2 +#if [ $? != 0 ]; then exit 1; fi +cmp f.p ff.p3 +if [ $? != 0 ]; then exit 1; fi + +/bin/rm -f f.* ff.* fff.* +exit 0 diff --git a/test/test.cnf b/test/test.cnf new file mode 100644 index 0000000000..faad3914a8 --- /dev/null +++ b/test/test.cnf @@ -0,0 +1,88 @@ +# +# SSLeay example configuration file. +# This is mostly being used for generation of certificate requests. +# + +RANDFILE = ./.rnd + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +new_certs_dir = $dir/new_certs # default place for new certs. + +certificate = $dir/CAcert.pem # The CA certificate +serial = $dir/serial # The current serial number +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/CAkey.pem# The private key +RANDFILE = $dir/private/.rand # private random number file + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = md5 # which md to use. + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match |