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

Side by Side Diff: openssl/crypto/x509/x509_set.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/x509/x509_req.c ('k') | openssl/crypto/x509/x509_trs.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/x509/x509_set.c */ 1 /* crypto/x509/x509_set.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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if ((x == NULL) || (x->cert_info == NULL)) return(0); 97 if ((x == NULL) || (x->cert_info == NULL)) return(0);
98 return(X509_NAME_set(&x->cert_info->issuer,name)); 98 return(X509_NAME_set(&x->cert_info->issuer,name));
99 } 99 }
100 100
101 int X509_set_subject_name(X509 *x, X509_NAME *name) 101 int X509_set_subject_name(X509 *x, X509_NAME *name)
102 { 102 {
103 if ((x == NULL) || (x->cert_info == NULL)) return(0); 103 if ((x == NULL) || (x->cert_info == NULL)) return(0);
104 return(X509_NAME_set(&x->cert_info->subject,name)); 104 return(X509_NAME_set(&x->cert_info->subject,name));
105 } 105 }
106 106
107 int X509_set_notBefore(X509 *x, ASN1_TIME *tm) 107 int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
108 { 108 {
109 ASN1_TIME *in; 109 ASN1_TIME *in;
110 110
111 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0); 111 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0);
112 in=x->cert_info->validity->notBefore; 112 in=x->cert_info->validity->notBefore;
113 if (in != tm) 113 if (in != tm)
114 { 114 {
115 in=M_ASN1_TIME_dup(tm); 115 in=M_ASN1_TIME_dup(tm);
116 if (in != NULL) 116 if (in != NULL)
117 { 117 {
118 M_ASN1_TIME_free(x->cert_info->validity->notBefore); 118 M_ASN1_TIME_free(x->cert_info->validity->notBefore);
119 x->cert_info->validity->notBefore=in; 119 x->cert_info->validity->notBefore=in;
120 } 120 }
121 } 121 }
122 return(in != NULL); 122 return(in != NULL);
123 } 123 }
124 124
125 int X509_set_notAfter(X509 *x, ASN1_TIME *tm) 125 int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
126 { 126 {
127 ASN1_TIME *in; 127 ASN1_TIME *in;
128 128
129 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0); 129 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0);
130 in=x->cert_info->validity->notAfter; 130 in=x->cert_info->validity->notAfter;
131 if (in != tm) 131 if (in != tm)
132 { 132 {
133 in=M_ASN1_TIME_dup(tm); 133 in=M_ASN1_TIME_dup(tm);
134 if (in != NULL) 134 if (in != NULL)
135 { 135 {
136 M_ASN1_TIME_free(x->cert_info->validity->notAfter); 136 M_ASN1_TIME_free(x->cert_info->validity->notAfter);
137 x->cert_info->validity->notAfter=in; 137 x->cert_info->validity->notAfter=in;
138 } 138 }
139 } 139 }
140 return(in != NULL); 140 return(in != NULL);
141 } 141 }
142 142
143 int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) 143 int X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
144 { 144 {
145 if ((x == NULL) || (x->cert_info == NULL)) return(0); 145 if ((x == NULL) || (x->cert_info == NULL)) return(0);
146 return(X509_PUBKEY_set(&(x->cert_info->key),pkey)); 146 return(X509_PUBKEY_set(&(x->cert_info->key),pkey));
147 } 147 }
148 148
149 149
150 150
OLDNEW
« no previous file with comments | « openssl/crypto/x509/x509_req.c ('k') | openssl/crypto/x509/x509_trs.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698