summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/demos/cms
diff options
context:
space:
mode:
Diffstat (limited to 'deps/openssl/openssl/demos/cms')
-rw-r--r--deps/openssl/openssl/demos/cms/cms_comp.c20
-rw-r--r--deps/openssl/openssl/demos/cms/cms_ddec.c33
-rw-r--r--deps/openssl/openssl/demos/cms/cms_dec.c30
-rw-r--r--deps/openssl/openssl/demos/cms/cms_denc.c33
-rw-r--r--deps/openssl/openssl/demos/cms/cms_enc.c30
-rw-r--r--deps/openssl/openssl/demos/cms/cms_sign.c30
-rw-r--r--deps/openssl/openssl/demos/cms/cms_sign2.c38
-rw-r--r--deps/openssl/openssl/demos/cms/cms_uncomp.c21
-rw-r--r--deps/openssl/openssl/demos/cms/cms_ver.c28
9 files changed, 132 insertions, 131 deletions
diff --git a/deps/openssl/openssl/demos/cms/cms_comp.c b/deps/openssl/openssl/demos/cms/cms_comp.c
index 059152fe0e..0d548f93ca 100644
--- a/deps/openssl/openssl/demos/cms/cms_comp.c
+++ b/deps/openssl/openssl/demos/cms/cms_comp.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -48,13 +57,8 @@ int main(int argc, char **argv)
ERR_print_errors_fp(stderr);
}
- if (cms)
- CMS_ContentInfo_free(cms);
- if (in)
- BIO_free(in);
- if (out)
- BIO_free(out);
-
+ CMS_ContentInfo_free(cms);
+ BIO_free(in);
+ BIO_free(out);
return ret;
-
}
diff --git a/deps/openssl/openssl/demos/cms/cms_ddec.c b/deps/openssl/openssl/demos/cms/cms_ddec.c
index 37ac97fd01..8f2e9aecb2 100644
--- a/deps/openssl/openssl/demos/cms/cms_ddec.c
+++ b/deps/openssl/openssl/demos/cms/cms_ddec.c
@@ -1,4 +1,13 @@
/*
+ * 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....
*/
@@ -68,22 +77,12 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_dec.c b/deps/openssl/openssl/demos/cms/cms_dec.c
index 3291eacab4..4f9428b4e7 100644
--- a/deps/openssl/openssl/demos/cms/cms_dec.c
+++ b/deps/openssl/openssl/demos/cms/cms_dec.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -59,20 +68,11 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_denc.c b/deps/openssl/openssl/demos/cms/cms_denc.c
index c86a5fd728..adba69b96d 100644
--- a/deps/openssl/openssl/demos/cms/cms_denc.c
+++ b/deps/openssl/openssl/demos/cms/cms_denc.c
@@ -1,4 +1,13 @@
/*
+ * 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....
*/
@@ -77,22 +86,12 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_enc.c b/deps/openssl/openssl/demos/cms/cms_enc.c
index e8ecb48e27..4d17d720c6 100644
--- a/deps/openssl/openssl/demos/cms/cms_enc.c
+++ b/deps/openssl/openssl/demos/cms/cms_enc.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -73,20 +82,11 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_sign.c b/deps/openssl/openssl/demos/cms/cms_sign.c
index 4bf85d1384..15bd5b8dd9 100644
--- a/deps/openssl/openssl/demos/cms/cms_sign.c
+++ b/deps/openssl/openssl/demos/cms/cms_sign.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -69,20 +78,11 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_sign2.c b/deps/openssl/openssl/demos/cms/cms_sign2.c
index 7e98a51713..14ebf27775 100644
--- a/deps/openssl/openssl/demos/cms/cms_sign2.c
+++ b/deps/openssl/openssl/demos/cms/cms_sign2.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -77,26 +86,13 @@ int main(int argc, char **argv)
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);
-
+ 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/deps/openssl/openssl/demos/cms/cms_uncomp.c b/deps/openssl/openssl/demos/cms/cms_uncomp.c
index 392f4b4502..3e3b4c4c6e 100644
--- a/deps/openssl/openssl/demos/cms/cms_uncomp.c
+++ b/deps/openssl/openssl/demos/cms/cms_uncomp.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -42,14 +51,8 @@ int main(int argc, char **argv)
ERR_print_errors_fp(stderr);
}
- if (cms)
- CMS_ContentInfo_free(cms);
-
- if (in)
- BIO_free(in);
- if (out)
- BIO_free(out);
-
+ CMS_ContentInfo_free(cms);
+ BIO_free(in);
+ BIO_free(out);
return ret;
-
}
diff --git a/deps/openssl/openssl/demos/cms/cms_ver.c b/deps/openssl/openssl/demos/cms/cms_ver.c
index ca935517a7..43c10e2513 100644
--- a/deps/openssl/openssl/demos/cms/cms_ver.c
+++ b/deps/openssl/openssl/demos/cms/cms_ver.c
@@ -1,3 +1,12 @@
+/*
+ * 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>
@@ -67,19 +76,10 @@ int main(int argc, char **argv)
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);
-
+ CMS_ContentInfo_free(cms);
+ X509_free(cacert);
+ BIO_free(in);
+ BIO_free(out);
+ BIO_free(tbio);
return ret;
-
}