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

Side by Side Diff: openssl/crypto/asn1/d2i_pu.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/crypto/asn1/d2i_pr.c ('k') | openssl/crypto/asn1/i2d_pr.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 /* crypto/asn1/d2i_pu.c */ 1 /* crypto/asn1/d2i_pu.c */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if ((a == NULL) || (*a == NULL)) 80 if ((a == NULL) || (*a == NULL))
81 { 81 {
82 if ((ret=EVP_PKEY_new()) == NULL) 82 if ((ret=EVP_PKEY_new()) == NULL)
83 { 83 {
84 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB); 84 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB);
85 return(NULL); 85 return(NULL);
86 } 86 }
87 } 87 }
88 else ret= *a; 88 else ret= *a;
89 89
90 » ret->save_type=type; 90 » if (!EVP_PKEY_set_type(ret, type))
91 » ret->type=EVP_PKEY_type(type); 91 » » {
92 » switch (ret->type) 92 » » ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB);
93 » » goto err;
94 » » }
95
96 » switch (EVP_PKEY_id(ret))
93 { 97 {
94 #ifndef OPENSSL_NO_RSA 98 #ifndef OPENSSL_NO_RSA
95 case EVP_PKEY_RSA: 99 case EVP_PKEY_RSA:
96 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL, 100 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
97 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ 101 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
98 { 102 {
99 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); 103 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
100 goto err; 104 goto err;
101 } 105 }
102 break; 106 break;
(...skipping 23 matching lines...) Expand all
126 goto err; 130 goto err;
127 /* break; */ 131 /* break; */
128 } 132 }
129 if (a != NULL) (*a)=ret; 133 if (a != NULL) (*a)=ret;
130 return(ret); 134 return(ret);
131 err: 135 err:
132 if ((ret != NULL) && ((a == NULL) || (*a != ret))) EVP_PKEY_free(ret); 136 if ((ret != NULL) && ((a == NULL) || (*a != ret))) EVP_PKEY_free(ret);
133 return(NULL); 137 return(NULL);
134 } 138 }
135 139
OLDNEW
« no previous file with comments | « openssl/crypto/asn1/d2i_pr.c ('k') | openssl/crypto/asn1/i2d_pr.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698