Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: openssl/demos/cms/cms_uncomp.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/demos/cms/cms_sign2.c ('k') | openssl/demos/cms/cms_ver.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Simple S/MIME uncompression example */
2 #include <openssl/pem.h>
3 #include <openssl/cms.h>
4 #include <openssl/err.h>
5
6 int main(int argc, char **argv)
7 {
8 BIO *in = NULL, *out = NULL;
9 CMS_ContentInfo *cms = NULL;
10 int ret = 1;
11
12 OpenSSL_add_all_algorithms();
13 ERR_load_crypto_strings();
14
15 /* Open compressed content */
16
17 in = BIO_new_file("smcomp.txt", "r");
18
19 if (!in)
20 goto err;
21
22 /* Sign content */
23 cms = SMIME_read_CMS(in, NULL);
24
25 if (!cms)
26 goto err;
27
28 out = BIO_new_file("smuncomp.txt", "w");
29 if (!out)
30 goto err;
31
32 /* Uncompress S/MIME message */
33 if (!CMS_uncompress(cms, out, NULL, 0))
34 goto err;
35
36 ret = 0;
37
38 err:
39
40 if (ret)
41 {
42 fprintf(stderr, "Error Uncompressing Data\n");
43 ERR_print_errors_fp(stderr);
44 }
45
46 if (cms)
47 CMS_ContentInfo_free(cms);
48
49 if (in)
50 BIO_free(in);
51 if (out)
52 BIO_free(out);
53
54 return ret;
55
56 }
OLDNEW
« no previous file with comments | « openssl/demos/cms/cms_sign2.c ('k') | openssl/demos/cms/cms_ver.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698