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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « openssl/demos/tunala/autoungunk.sh ('k') | openssl/demos/tunala/tunala.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: openssl/demos/tunala/cb.c
===================================================================
--- openssl/demos/tunala/cb.c (revision 105093)
+++ openssl/demos/tunala/cb.c (working copy)
@@ -134,8 +134,27 @@
/* TODO: Perhaps make it so our global key can be generated on-the-fly
* after certain intervals? */
static RSA *rsa_tmp = NULL;
- if(!rsa_tmp)
- rsa_tmp = RSA_generate_key(keylength, RSA_F4, NULL, NULL);
+ BIGNUM *bn = NULL;
+ int ok = 1;
+ if(!rsa_tmp) {
+ ok = 0;
+ if(!(bn = BN_new()))
+ goto end;
+ if(!BN_set_word(bn, RSA_F4))
+ goto end;
+ if(!(rsa_tmp = RSA_new()))
+ goto end;
+ if(!RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL))
+ goto end;
+ ok = 1;
+ }
+end:
+ if(bn)
+ BN_free(bn);
+ if(!ok) {
+ RSA_free(rsa_tmp);
+ rsa_tmp = NULL;
+ }
return rsa_tmp;
}
« 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