aboutsummaryrefslogtreecommitdiffstats
path: root/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms')
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cacert.pem29
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cakey.pem39
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_comp.c64
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ddec.c88
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_dec.c78
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_denc.c97
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_enc.c92
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign.c88
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign2.c98
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_uncomp.c58
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ver.c85
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/comp.txt22
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/encr.txt3
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/sign.txt3
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer.pem52
-rw-r--r--roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer2.pem52
16 files changed, 948 insertions, 0 deletions
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cacert.pem b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cacert.pem
new file mode 100644
index 000000000..1949fc33a
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cacert.pem
@@ -0,0 +1,29 @@
+-----BEGIN CERTIFICATE-----
+MIIFBjCCA26gAwIBAgIUM/WihZJZUTZvqoyNaUlp59DOaWYwDQYJKoZIhvcNAQEL
+BQAwVzELMAkGA1UEBhMCVUsxEjAQBgNVBAcMCVRlc3QgQ2l0eTEWMBQGA1UECgwN
+T3BlblNTTCBHcm91cDEcMBoGA1UEAwwTVGVzdCBTL01JTUUgUm9vdCBDQTAgFw0x
+ODA2MTQxMjQ2MjhaGA8yMTE4MDYxNDEyNDYyOFowVzELMAkGA1UEBhMCVUsxEjAQ
+BgNVBAcMCVRlc3QgQ2l0eTEWMBQGA1UECgwNT3BlblNTTCBHcm91cDEcMBoGA1UE
+AwwTVGVzdCBTL01JTUUgUm9vdCBDQTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCC
+AYoCggGBAMzxOVHZFVxN9XQIVW3y1bK5ir3jKpKkU6zKrw8MdRvm233eqWSOYJvs
+3rgdT59iv+CaPcBT5offbP0eH43H96CubJji/vQLMUzc/cLrJuCbLHREbSCsFNpf
+lYw5mkT98dCFV66HuN6Nwqi5kW8TxGSXkD4OZqklbbicrXoXh5qhREID5hgbrijy
+BiIHyp6bDq5zUCcmHP/Gdw2aTMEQZNsdw4Mav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5FizJNigL9qatGyRZ
+giJmWWlf0bMMIxwWZzQswxLyKdkNlvkKf9T6BjEmGLeOHZCn0x2sOyUi
+-----END CERTIFICATE-----
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cakey.pem b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cakey.pem
new file mode 100644
index 000000000..486c975b7
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cakey.pem
@@ -0,0 +1,39 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIG5QIBAAKCAYEAzPE5UdkVXE31dAhVbfLVsrmKveMqkqRTrMqvDwx1G+bbfd6p
+ZI5gm+zeuB1Pn2K/4Jo9wFPmh99s/R4fjcf3oK5smOL+9AsxTNz9wusm4JssdERt
+IKwU2l+VjDmaRP3x0IVXroe43o3CqLmRbxPEZJeQPg5mqSVtuJyteheHmqFEQgPm
+GBuuKPIGIgfKnpsOrnNQJyYc/8Z3DZpMwRBk2x3Dgxq+0Hrm8jt1jGjbMTN2Ync2
+eOUbupno53pXghbzJEAr0YuPRNQJmXbymrqs2Kj4Xkuy3dyVf08PGHsumE2tddiI
+eNenYqctls6fPVIlKYJ6KzL8QU3p9G3B3CpwzUBwo0FT5SoWrQy/SyA11HCCFhYZ
+CG3SZP34+DkfFPMOU46YFPWQB27Ek0uJFCWDKw8M33g6zQSnMnIDztnrIlEa9gZn
+mat1/Hbynpsem1/jqHVbMJfjAPLYnzrL6h2BYydKSYX2HzJKPrquCYuvPjSf6YOb
+xuFRuUoBXwio3xaZAgMBAAECggGBAJrqILzozke2ujpablEtBTITJHgC9lRgmMt9
+bjR+4ysTJ4kOvZbANPDIbVZY+a3uVEIv9UujYBgG4Hi4w3tF074G+xnaRIQuzbZf
+OgaUABA527GLY74VtbGYHRAhHqbWGmrX0H6iIzE/kQw/MVr4YzTyiFsQQbPMEhNB
+g7RNgvh0vIb2MYC5s71JrS8eGqAnb0KY8daV7ce9upJy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un+n2TK6+RmE2Q5jmAeFne9PYdZbb+Ame7fkYwBbcAsoQKBwQC1KHQSZyp7LGsH
+0Vq5Mr77/i2FeQ1eg4SnvaZ8S8UHWla/iIVgX3XAcYO7SJ76F00CX8SQ5dLyhrr5
+YBG8u6k8LHHPMzVtmqoPU7cePDAjGWIddQ1g15WihILsgqCD+8z3YPxvfa1RsOvh
+jyt4Ca0WEmLnr7v5xhp9pNRIPewUpvjwrR+cfyeEGjjat4tX5Wh/tzym51y7vvVM
+Pa3I0M3BtQyqIa2ip8MS2eWcIs1TN2qHOorOolwHaLEDZY38fIECgcAKns98A2G3
+tLvZaDZlVsJWZsdSDUrFCKvx9QbTZHbyOL5JU/8TgLBgfOgV2yxLXn9Pq+0Quvb2
+EjaFuA3GKOFi50WtfwR6Yo1DaFcx5n0bDShnaHOF+dUi0BVQd2V1DsqAwF5/Eh3A
+lX+XuWeSam4/91WhmNMCZpfYv0GErs4ZBHHsl54jmvrrjbhg/efUvpWKi/9vlKm+
++ITH+nG1xCnyEEVZ+vm9Qq57lCLBZGyGT4PetllpsRrGcdO4/gfK8lY=
+-----END RSA PRIVATE KEY-----
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_comp.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_comp.c
new file mode 100644
index 000000000..0d548f93c
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_comp.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ BIO_free(in);
+ BIO_free(out);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ddec.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ddec.c
new file mode 100644
index 000000000..8f2e9aecb
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ddec.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(rcert);
+ EVP_PKEY_free(rkey);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ BIO_free(dcont);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_dec.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_dec.c
new file mode 100644
index 000000000..4f9428b4e
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_dec.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(rcert);
+ EVP_PKEY_free(rkey);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_denc.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_denc.c
new file mode 100644
index 000000000..adba69b96
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_denc.c
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(rcert);
+ sk_X509_pop_free(recips, X509_free);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(dout);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_enc.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_enc.c
new file mode 100644
index 000000000..4d17d720c
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_enc.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(rcert);
+ sk_X509_pop_free(recips, X509_free);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign.c
new file mode 100644
index 000000000..15bd5b8dd
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(scert);
+ EVP_PKEY_free(skey);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign2.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign2.c
new file mode 100644
index 000000000..14ebf2777
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_sign2.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(scert);
+ EVP_PKEY_free(skey);
+ X509_free(scert2);
+ EVP_PKEY_free(skey2);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_uncomp.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_uncomp.c
new file mode 100644
index 000000000..3e3b4c4c6
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_uncomp.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ BIO_free(in);
+ BIO_free(out);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ver.c b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ver.c
new file mode 100644
index 000000000..43c10e251
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/cms_ver.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* 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);
+ }
+
+ CMS_ContentInfo_free(cms);
+ X509_free(cacert);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
+ return ret;
+}
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/comp.txt b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/comp.txt
new file mode 100644
index 000000000..1672328e7
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/comp.txt
@@ -0,0 +1,22 @@
+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/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/encr.txt b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/encr.txt
new file mode 100644
index 000000000..0eceb407b
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/encr.txt
@@ -0,0 +1,3 @@
+Content-type: text/plain
+
+Sample OpenSSL Data for CMS encryption
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/sign.txt b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/sign.txt
new file mode 100644
index 000000000..c3f9d73d6
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/sign.txt
@@ -0,0 +1,3 @@
+Content-type: text/plain
+
+Test OpenSSL CMS Signed Content
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer.pem b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer.pem
new file mode 100644
index 000000000..4bbf7a69f
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer.pem
@@ -0,0 +1,52 @@
+-----BEGIN CERTIFICATE-----
+MIIELDCCApSgAwIBAgIIcsOElVeHzfQwDQYJKoZIhvcNAQELBQAwVzELMAkGA1UE
+BhMCVUsxEjAQBgNVBAcMCVRlc3QgQ2l0eTEWMBQGA1UECgwNT3BlblNTTCBHcm91
+cDEcMBoGA1UEAwwTVGVzdCBTL01JTUUgUm9vdCBDQTAgFw0xODA2MTQxMjQ2Mjha
+GA8yMTE4MDYxNDEyNDYyOFowVjELMAkGA1UEBhMCVUsxJTAjBgNV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+aCipblofnO9sF4AhShq1AoGBANjj
+Ou0czloNORbk3qAxLi4b5P/YOyZBJDa0zijFdD1jImfOeyNFXeg2ID+8ZjDkP/eP
+pLy/Gt/8bVb+O+9wMOho3kWKZBN3O2VsLJYakAehDsC5ax7i2HtEqg1L1krW2duS
+POiKg3qNjETM30zTA4pHwkNAETIktResze7SRm0XAoGABH7KaLMS5mZFXjcMwF19
+TpuDVmJHkgWqB7DfTWD6ZcZLvr4irdwHWlNq7ELX5P6MAmaTerkqwk9C4hLYZSzf
+9jOgS8jhlm/HOXgXGcZ9OV4jMHJ0/Sl2I1eNCvvtJKjuUqS2mrLpuLbPtBdhqJoo
+91HYNIgz3ULcG921WN6+GlUCgYEA066T6LDgxgt52NpwXrEhfWdETmDg+ilCCxLU
+0/5DwVZsUhy5Gmeti+Kn/w0GQFnGBP1xr7ZlqI9auDlSjhNV6L/RkNXNbyJEGm1F
+5wrt4ERVfcx6vJ5y43zU7D1EXa7s2t0UDXKDeK2GZe//UZ/yKJh5BeIV5nblOMI0
+DA+3JOkCgYEA80QGLjGlCvxKceVbuohbIZ1+/EoXPq993ER9S8D2MTGATsEcygtF
+rM8JcHTv75sjycqu68BAQr1Z5qwwrMyY0vWVEorKzvAXEWolC67asR4cDutOd+qy
+WlEIyojX45GwHCHpcbVRiGRWuj3kwkc+WzdgusBoAJrPCigES/Cr8uA=
+-----END RSA PRIVATE KEY-----
diff --git a/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer2.pem b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer2.pem
new file mode 100644
index 000000000..52827297e
--- /dev/null
+++ b/roms/edk2/CryptoPkg/Library/OpensslLib/openssl/demos/cms/signer2.pem
@@ -0,0 +1,52 @@
+-----BEGIN CERTIFICATE-----
+MIIELDCCApSgAwIBAgIIcsOElVeHzfUwDQYJKoZIhvcNAQELBQAwVzELMAkGA1UE
+BhMCVUsxEjAQBgNVBAcMCVRlc3QgQ2l0eTEWMB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