diff options
author | 2014-04-16 18:35:14 +0000 | |
---|---|---|
committer | 2014-04-16 18:35:14 +0000 | |
commit | 3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4 (patch) | |
tree | 32478f30a546d3890772d75727312fb4cd4165ea /lib/libssl/src/demos/cms | |
parent | delete a few leftovers (diff) | |
download | wireguard-openbsd-3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4.tar.xz wireguard-openbsd-3b6d1e39d63b84cd880dd908ad8efe1fc9aa53f4.zip |
quoth the readme:
NOTE: Don't expect any of these programs to work with current
OpenSSL releases, or even with later SSLeay releases.
ok miod
Diffstat (limited to 'lib/libssl/src/demos/cms')
-rw-r--r-- | lib/libssl/src/demos/cms/cacert.pem | 18 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cakey.pem | 15 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_comp.c | 61 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_ddec.c | 89 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_dec.c | 79 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_denc.c | 97 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_enc.c | 92 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_sign.c | 89 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_sign2.c | 103 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_uncomp.c | 56 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/cms_ver.c | 87 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/comp.txt | 22 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/encr.txt | 3 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/sign.txt | 3 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/signer.pem | 32 | ||||
-rw-r--r-- | lib/libssl/src/demos/cms/signer2.pem | 32 |
16 files changed, 0 insertions, 878 deletions
diff --git a/lib/libssl/src/demos/cms/cacert.pem b/lib/libssl/src/demos/cms/cacert.pem deleted file mode 100644 index 75cbb347aaa..00000000000 --- a/lib/libssl/src/demos/cms/cacert.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC6DCCAlGgAwIBAgIJAMfGO3rdo2uUMA0GCSqGSIb3DQEBBAUAMFcxCzAJBgNV -BAYTAlVLMRIwEAYDVQQHEwlUZXN0IENpdHkxFjAUBgNVBAoTDU9wZW5TU0wgR3Jv -dXAxHDAaBgNVBAMTE1Rlc3QgUy9NSU1FIFJvb3QgQ0EwHhcNMDcwNDEzMTc0MzE3 -WhcNMTcwNDEwMTc0MzE3WjBXMQswCQYDVQQGEwJVSzESMBAGA1UEBxMJVGVzdCBD -aXR5MRYwFAYDVQQKEw1PcGVuU1NMIEdyb3VwMRwwGgYDVQQDExNUZXN0IFMvTUlN -RSBSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqJMal1uC1/1wz -i5+dE4EZF2im3BgROm5PVMbwPY9V1t+KYvtdc3rMcRgJaMbP+qaEcDXoIsZfYXGR -ielgfDNZmZcj1y/FOum+Jc2OZMs3ggPmjIQ3dbBECq0hZKcbz7wfr+2OeNWm46iT -jcSIXpGIRhUYEzOgv7zb8oOU70IbbwIDAQABo4G7MIG4MB0GA1UdDgQWBBRHUypx -CXFQYqewhGo72lWPQUsjoDCBiAYDVR0jBIGAMH6AFEdTKnEJcVBip7CEajvaVY9B -SyOgoVukWTBXMQswCQYDVQQGEwJVSzESMBAGA1UEBxMJVGVzdCBDaXR5MRYwFAYD -VQQKEw1PcGVuU1NMIEdyb3VwMRwwGgYDVQQDExNUZXN0IFMvTUlNRSBSb290IENB -ggkAx8Y7et2ja5QwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQANI+Yc -G/YDM1WMUGEzEkU9UhsIUqdyBebnK3+OyxZSouDcE/M10jFJzBf/F5b0uUGAKWwo -u0dzmILfKjdfWe8EyCRafZcm00rVcO09i/63FBYzlHbmfUATIqZdhKzxxQMPs5mF -1je+pHUpzIY8TSXyh/uD9IkAy04IHwGZQf9akw== ------END CERTIFICATE----- diff --git a/lib/libssl/src/demos/cms/cakey.pem b/lib/libssl/src/demos/cms/cakey.pem deleted file mode 100644 index 3b53c5e8175..00000000000 --- a/lib/libssl/src/demos/cms/cakey.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQCqJMal1uC1/1wzi5+dE4EZF2im3BgROm5PVMbwPY9V1t+KYvtd -c3rMcRgJaMbP+qaEcDXoIsZfYXGRielgfDNZmZcj1y/FOum+Jc2OZMs3ggPmjIQ3 -dbBECq0hZKcbz7wfr+2OeNWm46iTjcSIXpGIRhUYEzOgv7zb8oOU70IbbwIDAQAB -AoGBAKWOZ2UTc1BkjDjz0XoscmAR8Rj77MdGzfOPkIxPultSW+3yZpkGNyUbnsH5 -HAtf4Avai/m3bMN+s91kDpx9/g/I9ZEHPQLcDICETvwt/EHT7+hwvaQgsM+TgpMs -tjlGZOWent6wVIuvwwzqOMXZLgK9FvY7upwgtrys4G3Kab5hAkEA2QzFflWyEvKS -rMSaVtn/IjFilwa7H0IdakkjM34z4peerFTPBr4J47YD4RCR/dAvxyNy3zUxtH18 -9R6dUixI6QJBAMitJD0xOkbGWBX8KVJvRiKOIdf/95ZUAgN/h3bWKy57EB9NYj3u -jbxXcvdjfSqiITykkjAg7SG7nrlzJsu6CpcCQG6gVsy0auXDY0TRlASuaZ6I40Is -uRUOgqWYj2uAaHuWYdZeB4LdO3cnX0TISFDAWom6JKNlnmbrCtR4fSDT13kCQQCU -+VQJyV3F5MDHsWbLt6eNR46AV5lpk/vatPXPlrZ/zwPs+PmRmGLICvNiDA2DdNDP -wCx2Zjsj67CtY3rNitMJAkEAm09BQnjnbBXUb1rd2SjNDWTsu80Z+zLu8pAwXNhW -8nsvMYqlYMIxuMPwu/QuTnMRhMZ08uhqoD3ukZnBeoMEVg== ------END RSA PRIVATE KEY----- diff --git a/lib/libssl/src/demos/cms/cms_comp.c b/lib/libssl/src/demos/cms/cms_comp.c deleted file mode 100644 index 01bf092546f..00000000000 --- a/lib/libssl/src/demos/cms/cms_comp.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Simple S/MIME compress example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - /* - * On OpenSSL 1.0.0+ only: - * for streaming set CMS_STREAM - */ - int flags = CMS_STREAM; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Open content being compressed */ - - in = BIO_new_file("comp.txt", "r"); - - if (!in) - goto err; - - /* compress content */ - cms = CMS_compress(in, NID_zlib_compression, flags); - - if (!cms) - goto err; - - out = BIO_new_file("smcomp.txt", "w"); - if (!out) - goto err; - - /* Write out S/MIME message */ - if (!SMIME_write_CMS(out, cms, in, flags)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Compressing Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (in) - BIO_free(in); - if (out) - BIO_free(out); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_ddec.c b/lib/libssl/src/demos/cms/cms_ddec.c deleted file mode 100644 index ba68cfdf764..00000000000 --- a/lib/libssl/src/demos/cms/cms_ddec.c +++ /dev/null @@ -1,89 +0,0 @@ -/* S/MIME detached data decrypt example: rarely done but - * should the need arise this is an example.... - */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL, *dcont = NULL; - X509 *rcert = NULL; - EVP_PKEY *rkey = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Read in recipient certificate and private key */ - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - BIO_reset(tbio); - - rkey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); - - if (!rcert || !rkey) - goto err; - - /* Open PEM file containing enveloped data */ - - in = BIO_new_file("smencr.pem", "r"); - - if (!in) - goto err; - - /* Parse PEM content */ - cms = PEM_read_bio_CMS(in, NULL, 0, NULL); - - if (!cms) - goto err; - - /* Open file containing detached content */ - dcont = BIO_new_file("smencr.out", "rb"); - - if (!in) - goto err; - - out = BIO_new_file("encrout.txt", "w"); - if (!out) - goto err; - - /* Decrypt S/MIME message */ - if (!CMS_decrypt(cms, rkey, rcert, dcont, out, 0)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Decrypting Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (rkey) - EVP_PKEY_free(rkey); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - if (dcont) - BIO_free(dcont); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_dec.c b/lib/libssl/src/demos/cms/cms_dec.c deleted file mode 100644 index 9fee0a3ebfc..00000000000 --- a/lib/libssl/src/demos/cms/cms_dec.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Simple S/MIME decryption example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL; - X509 *rcert = NULL; - EVP_PKEY *rkey = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Read in recipient certificate and private key */ - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - BIO_reset(tbio); - - rkey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); - - if (!rcert || !rkey) - goto err; - - /* Open S/MIME message to decrypt */ - - in = BIO_new_file("smencr.txt", "r"); - - if (!in) - goto err; - - /* Parse message */ - cms = SMIME_read_CMS(in, NULL); - - if (!cms) - goto err; - - out = BIO_new_file("decout.txt", "w"); - if (!out) - goto err; - - /* Decrypt S/MIME message */ - if (!CMS_decrypt(cms, rkey, rcert, NULL, out, 0)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Decrypting Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (rkey) - EVP_PKEY_free(rkey); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_denc.c b/lib/libssl/src/demos/cms/cms_denc.c deleted file mode 100644 index 9265e47bf95..00000000000 --- a/lib/libssl/src/demos/cms/cms_denc.c +++ /dev/null @@ -1,97 +0,0 @@ -/* S/MIME detached data encrypt example: rarely done but - * should the need arise this is an example.... - */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL, *dout = NULL; - X509 *rcert = NULL; - STACK_OF(X509) *recips = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - int flags = CMS_STREAM|CMS_DETACHED; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Read in recipient certificate */ - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - if (!rcert) - goto err; - - /* Create recipient STACK and add recipient cert to it */ - recips = sk_X509_new_null(); - - if (!recips || !sk_X509_push(recips, rcert)) - goto err; - - /* sk_X509_pop_free will free up recipient STACK and its contents - * so set rcert to NULL so it isn't freed up twice. - */ - rcert = NULL; - - /* Open content being encrypted */ - - in = BIO_new_file("encr.txt", "r"); - - dout = BIO_new_file("smencr.out", "wb"); - - if (!in) - goto err; - - /* encrypt content */ - cms = CMS_encrypt(recips, in, EVP_des_ede3_cbc(), flags); - - if (!cms) - goto err; - - out = BIO_new_file("smencr.pem", "w"); - if (!out) - goto err; - - if (!CMS_final(cms, in, dout, flags)) - goto err; - - /* Write out CMS structure without content */ - if (!PEM_write_bio_CMS(out, cms)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Encrypting Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (recips) - sk_X509_pop_free(recips, X509_free); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (dout) - BIO_free(dout); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_enc.c b/lib/libssl/src/demos/cms/cms_enc.c deleted file mode 100644 index 916b479d3c6..00000000000 --- a/lib/libssl/src/demos/cms/cms_enc.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Simple S/MIME encrypt example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL; - X509 *rcert = NULL; - STACK_OF(X509) *recips = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - /* - * On OpenSSL 1.0.0 and later only: - * for streaming set CMS_STREAM - */ - int flags = CMS_STREAM; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Read in recipient certificate */ - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - if (!rcert) - goto err; - - /* Create recipient STACK and add recipient cert to it */ - recips = sk_X509_new_null(); - - if (!recips || !sk_X509_push(recips, rcert)) - goto err; - - /* sk_X509_pop_free will free up recipient STACK and its contents - * so set rcert to NULL so it isn't freed up twice. - */ - rcert = NULL; - - /* Open content being encrypted */ - - in = BIO_new_file("encr.txt", "r"); - - if (!in) - goto err; - - /* encrypt content */ - cms = CMS_encrypt(recips, in, EVP_des_ede3_cbc(), flags); - - if (!cms) - goto err; - - out = BIO_new_file("smencr.txt", "w"); - if (!out) - goto err; - - /* Write out S/MIME message */ - if (!SMIME_write_CMS(out, cms, in, flags)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Encrypting Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (rcert) - X509_free(rcert); - if (recips) - sk_X509_pop_free(recips, X509_free); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_sign.c b/lib/libssl/src/demos/cms/cms_sign.c deleted file mode 100644 index 6823c34a0e3..00000000000 --- a/lib/libssl/src/demos/cms/cms_sign.c +++ /dev/null @@ -1,89 +0,0 @@ -/* Simple S/MIME signing example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL; - X509 *scert = NULL; - EVP_PKEY *skey = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - /* For simple S/MIME signing use CMS_DETACHED. - * On OpenSSL 1.0.0 only: - * for streaming detached set CMS_DETACHED|CMS_STREAM - * for streaming non-detached set CMS_STREAM - */ - int flags = CMS_DETACHED|CMS_STREAM; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Read in signer certificate and private key */ - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - scert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - BIO_reset(tbio); - - skey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); - - if (!scert || !skey) - goto err; - - /* Open content being signed */ - - in = BIO_new_file("sign.txt", "r"); - - if (!in) - goto err; - - /* Sign content */ - cms = CMS_sign(scert, skey, NULL, in, flags); - - if (!cms) - goto err; - - out = BIO_new_file("smout.txt", "w"); - if (!out) - goto err; - - if (!(flags & CMS_STREAM)) - BIO_reset(in); - - /* Write out S/MIME message */ - if (!SMIME_write_CMS(out, cms, in, flags)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Signing Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - if (scert) - X509_free(scert); - if (skey) - EVP_PKEY_free(skey); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_sign2.c b/lib/libssl/src/demos/cms/cms_sign2.c deleted file mode 100644 index 36adee73041..00000000000 --- a/lib/libssl/src/demos/cms/cms_sign2.c +++ /dev/null @@ -1,103 +0,0 @@ -/* S/MIME signing example: 2 signers */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL; - X509 *scert = NULL, *scert2 = NULL; - EVP_PKEY *skey = NULL, *skey2 = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - tbio = BIO_new_file("signer.pem", "r"); - - if (!tbio) - goto err; - - scert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - BIO_reset(tbio); - - skey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); - - BIO_free(tbio); - - tbio = BIO_new_file("signer2.pem", "r"); - - if (!tbio) - goto err; - - scert2 = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - BIO_reset(tbio); - - skey2 = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); - - if (!scert2 || !skey2) - goto err; - - in = BIO_new_file("sign.txt", "r"); - - if (!in) - goto err; - - cms = CMS_sign(NULL, NULL, NULL, in, CMS_STREAM|CMS_PARTIAL); - - if (!cms) - goto err; - - /* Add each signer in turn */ - - if (!CMS_add1_signer(cms, scert, skey, NULL, 0)) - goto err; - - if (!CMS_add1_signer(cms, scert2, skey2, NULL, 0)) - goto err; - - out = BIO_new_file("smout.txt", "w"); - if (!out) - goto err; - - /* NB: content included and finalized by SMIME_write_CMS */ - - if (!SMIME_write_CMS(out, cms, in, CMS_STREAM)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Signing Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - - if (scert) - X509_free(scert); - if (skey) - EVP_PKEY_free(skey); - - if (scert2) - X509_free(scert2); - if (skey) - EVP_PKEY_free(skey2); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_uncomp.c b/lib/libssl/src/demos/cms/cms_uncomp.c deleted file mode 100644 index f15ae2f1327..00000000000 --- a/lib/libssl/src/demos/cms/cms_uncomp.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Simple S/MIME uncompression example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL; - CMS_ContentInfo *cms = NULL; - int ret = 1; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Open compressed content */ - - in = BIO_new_file("smcomp.txt", "r"); - - if (!in) - goto err; - - /* Sign content */ - cms = SMIME_read_CMS(in, NULL); - - if (!cms) - goto err; - - out = BIO_new_file("smuncomp.txt", "w"); - if (!out) - goto err; - - /* Uncompress S/MIME message */ - if (!CMS_uncompress(cms, out, NULL, 0)) - goto err; - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Uncompressing Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/cms_ver.c b/lib/libssl/src/demos/cms/cms_ver.c deleted file mode 100644 index bf1145ed8be..00000000000 --- a/lib/libssl/src/demos/cms/cms_ver.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Simple S/MIME verification example */ -#include <openssl/pem.h> -#include <openssl/cms.h> -#include <openssl/err.h> - -int main(int argc, char **argv) - { - BIO *in = NULL, *out = NULL, *tbio = NULL, *cont = NULL; - X509_STORE *st = NULL; - X509 *cacert = NULL; - CMS_ContentInfo *cms = NULL; - - int ret = 1; - - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - /* Set up trusted CA certificate store */ - - st = X509_STORE_new(); - - /* Read in CA certificate */ - tbio = BIO_new_file("cacert.pem", "r"); - - if (!tbio) - goto err; - - cacert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - - if (!cacert) - goto err; - - if (!X509_STORE_add_cert(st, cacert)) - goto err; - - /* Open message being verified */ - - in = BIO_new_file("smout.txt", "r"); - - if (!in) - goto err; - - /* parse message */ - cms = SMIME_read_CMS(in, &cont); - - if (!cms) - goto err; - - /* File to output verified content to */ - out = BIO_new_file("smver.txt", "w"); - if (!out) - goto err; - - if (!CMS_verify(cms, NULL, st, cont, out, 0)) - { - fprintf(stderr, "Verification Failure\n"); - goto err; - } - - fprintf(stderr, "Verification Successful\n"); - - ret = 0; - - err: - - if (ret) - { - fprintf(stderr, "Error Verifying Data\n"); - ERR_print_errors_fp(stderr); - } - - if (cms) - CMS_ContentInfo_free(cms); - - if (cacert) - X509_free(cacert); - - if (in) - BIO_free(in); - if (out) - BIO_free(out); - if (tbio) - BIO_free(tbio); - - return ret; - - } diff --git a/lib/libssl/src/demos/cms/comp.txt b/lib/libssl/src/demos/cms/comp.txt deleted file mode 100644 index 1672328e773..00000000000 --- a/lib/libssl/src/demos/cms/comp.txt +++ /dev/null @@ -1,22 +0,0 @@ -Content-type: text/plain - -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed -Some Text To be Compressed diff --git a/lib/libssl/src/demos/cms/encr.txt b/lib/libssl/src/demos/cms/encr.txt deleted file mode 100644 index 0eceb407b53..00000000000 --- a/lib/libssl/src/demos/cms/encr.txt +++ /dev/null @@ -1,3 +0,0 @@ -Content-type: text/plain - -Sample OpenSSL Data for CMS encryption diff --git a/lib/libssl/src/demos/cms/sign.txt b/lib/libssl/src/demos/cms/sign.txt deleted file mode 100644 index c3f9d73d65e..00000000000 --- a/lib/libssl/src/demos/cms/sign.txt +++ /dev/null @@ -1,3 +0,0 @@ -Content-type: text/plain - -Test OpenSSL CMS Signed Content diff --git a/lib/libssl/src/demos/cms/signer.pem b/lib/libssl/src/demos/cms/signer.pem deleted file mode 100644 index bac16ba9636..00000000000 --- a/lib/libssl/src/demos/cms/signer.pem +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICpjCCAg+gAwIBAgIJAJ+rfmEoLQRhMA0GCSqGSIb3DQEBBAUAMFcxCzAJBgNV -BAYTAlVLMRIwEAYDVQQHEwlUZXN0IENpdHkxFjAUBgNVBAoTDU9wZW5TU0wgR3Jv -dXAxHDAaBgNVBAMTE1Rlc3QgUy9NSU1FIFJvb3QgQ0EwHhcNMDcwNDEzMTgyOTI3 -WhcNMTcwNDA5MTgyOTI3WjBWMQswCQYDVQQGEwJVSzElMCMGA1UEAxMcT3BlblNT -TCB0ZXN0IFMvTUlNRSBzaWduZXIgMTEgMB4GCSqGSIb3DQEJARYRdGVzdDFAb3Bl -bnNzbC5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL1ocAQ7ON2pIUXz -jwKPzpPB9ozB6PFG6F6kARO+i0DiT6Qn8abU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S38+XsIIwJBANSRuIU3G66tkr5l4gnhhAaxqtuY -sgVhvvdL8dvC9aG1Ifzt9hzBSthpHxbK+oYmK07HdhI8hLpIMLHYzoK7n3MCQEy4 -4rccBcxyyYiAkjozp+QNNIpgTBMPJ6pGT7lRLiHtBeV4y1NASdv/LTnk+Fi69Bid -7t3H24ytfHcHmS1yn6ECQF6Jmh4C7dlvp59zXp+t+VsXxa/8sq41vKNIj0Rx9vh5 -xp9XL0C5ZpgmBnsTydP9pmkiL4ltLbMX0wJU6N2cmFw= ------END RSA PRIVATE KEY----- diff --git a/lib/libssl/src/demos/cms/signer2.pem b/lib/libssl/src/demos/cms/signer2.pem deleted file mode 100644 index 25e23d131af..00000000000 --- a/lib/libssl/src/demos/cms/signer2.pem +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICpjCCAg+gAwIBAgIJAJ+rfmEoLQRiMA0GCSqGSIb3DQEBBAUAMFcxCzAJBgNV -BAYTAlVLMRIwEAYDVQQHEwlUZXN0IENpdHkxFjAUBgNVBAoTDU9wZW5TU0wgR3Jv -dXAxHDAaBgNVBAMTE1Rlc3QgUy9NSU1FIFJvb3QgQ0EwHhcNMDcwNDEzMTgyOTQ0 -WhcNMTcwNDA5MTgyOTQ0WjBWMQswCQYDVQQGEwJVSzElMCMGA1UEAxMcT3BlblNT -TCB0ZXN0IFMvTUlNRSBzaWduZXIgMjEgMB4GCSqGSIb3DQEJARYRdGVzdDJAb3Bl -bnNzbC5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANco7VPgX9vcGwmZ -jYqjq1JiR7M38dsMNhuJyLRVjJ5/cpFluQydQuG1PhzOJ8zfYVFicOXKvbYuKuXW -ozZIwzqEqWsNf36KHTLS6yOMG8I13cRInh+fAIKq9Z8Eh65I7FJzVsNsfEQrGfEW -GMA8us24IaSvP3QkbfHJn/4RaKznAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZI -AYb4QgENBB8WHU9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ray++zvC2DV/86x8CQH4UJwgO6JqU4bSgi6HiRNjDg26tJ0Beu8jjl1vrkIVX -pHFwSUeLZUsT2/iTUSgYH4uYiZPgYNcKTCT9W6se30A= ------END RSA PRIVATE KEY----- |