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

Side by Side Diff: openssl/demos/tunala/cb.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/tunala/autoungunk.sh ('k') | openssl/demos/tunala/tunala.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "tunala.h" 1 #include "tunala.h"
2 2
3 #ifndef NO_OPENSSL 3 #ifndef NO_OPENSSL
4 4
5 /* For callbacks generating output, here are their file-descriptors. */ 5 /* For callbacks generating output, here are their file-descriptors. */
6 static FILE *fp_cb_ssl_info = NULL; 6 static FILE *fp_cb_ssl_info = NULL;
7 static FILE *fp_cb_ssl_verify = NULL; 7 static FILE *fp_cb_ssl_verify = NULL;
8 /* Output level: 8 /* Output level:
9 * 0 = nothing, 9 * 0 = nothing,
10 * 1 = minimal, just errors, 10 * 1 = minimal, just errors,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 { 127 {
128 if(level < 4) 128 if(level < 4)
129 cb_ssl_verify_level = level; 129 cb_ssl_verify_level = level;
130 } 130 }
131 131
132 RSA *cb_generate_tmp_rsa(SSL *s, int is_export, int keylength) 132 RSA *cb_generate_tmp_rsa(SSL *s, int is_export, int keylength)
133 { 133 {
134 /* TODO: Perhaps make it so our global key can be generated on-the-fly 134 /* TODO: Perhaps make it so our global key can be generated on-the-fly
135 * after certain intervals? */ 135 * after certain intervals? */
136 static RSA *rsa_tmp = NULL; 136 static RSA *rsa_tmp = NULL;
137 » if(!rsa_tmp) 137 » BIGNUM *bn = NULL;
138 » » rsa_tmp = RSA_generate_key(keylength, RSA_F4, NULL, NULL); 138 » int ok = 1;
139 » if(!rsa_tmp) {
140 » » ok = 0;
141 » » if(!(bn = BN_new()))
142 » » » goto end;
143 » » if(!BN_set_word(bn, RSA_F4))
144 » » » goto end;
145 » » if(!(rsa_tmp = RSA_new()))
146 » » » goto end;
147 » » if(!RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL))
148 » » » goto end;
149 » » ok = 1;
150 » }
151 end:
152 » if(bn)
153 » » BN_free(bn);
154 » if(!ok) {
155 » » RSA_free(rsa_tmp);
156 » » rsa_tmp = NULL;
157 » }
139 return rsa_tmp; 158 return rsa_tmp;
140 } 159 }
141 160
142 #endif /* !defined(NO_OPENSSL) */ 161 #endif /* !defined(NO_OPENSSL) */
143 162
OLDNEW
« no previous file with comments | « openssl/demos/tunala/autoungunk.sh ('k') | openssl/demos/tunala/tunala.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698