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

Side by Side Diff: openssl/ssl/s2_enc.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/ssl/s2_clnt.c ('k') | openssl/ssl/s2_lib.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 /* ssl/s2_enc.c */ 1 /* ssl/s2_enc.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include <stdio.h> 61 #include <stdio.h>
62 62
63 int ssl2_enc_init(SSL *s, int client) 63 int ssl2_enc_init(SSL *s, int client)
64 { 64 {
65 /* Max number of bytes needed */ 65 /* Max number of bytes needed */
66 EVP_CIPHER_CTX *rs,*ws; 66 EVP_CIPHER_CTX *rs,*ws;
67 const EVP_CIPHER *c; 67 const EVP_CIPHER *c;
68 const EVP_MD *md; 68 const EVP_MD *md;
69 int num; 69 int num;
70 70
71 » if (!ssl_cipher_get_evp(s->session,&c,&md,NULL)) 71 » if (!ssl_cipher_get_evp(s->session,&c,&md,NULL,NULL,NULL))
72 { 72 {
73 ssl2_return_error(s,SSL2_PE_NO_CIPHER); 73 ssl2_return_error(s,SSL2_PE_NO_CIPHER);
74 SSLerr(SSL_F_SSL2_ENC_INIT,SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIO NS); 74 SSLerr(SSL_F_SSL2_ENC_INIT,SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIO NS);
75 return(0); 75 return(0);
76 } 76 }
77 77 » ssl_replace_hash(&s->read_hash,md);
78 » s->read_hash=md; 78 » ssl_replace_hash(&s->write_hash,md);
79 » s->write_hash=md;
80 79
81 if ((s->enc_read_ctx == NULL) && 80 if ((s->enc_read_ctx == NULL) &&
82 ((s->enc_read_ctx=(EVP_CIPHER_CTX *) 81 ((s->enc_read_ctx=(EVP_CIPHER_CTX *)
83 OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)) 82 OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
84 goto err; 83 goto err;
85 84
86 /* make sure it's intialized in case the malloc for enc_write_ctx fails 85 /* make sure it's intialized in case the malloc for enc_write_ctx fails
87 * and we exit with an error */ 86 * and we exit with an error */
88 rs= s->enc_read_ctx; 87 rs= s->enc_read_ctx;
89 EVP_CIPHER_CTX_init(rs); 88 EVP_CIPHER_CTX_init(rs);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 sec=s->s2->read_key; 168 sec=s->s2->read_key;
170 len=s->s2->ract_data_length; 169 len=s->s2->ract_data_length;
171 act=s->s2->ract_data; 170 act=s->s2->ract_data;
172 } 171 }
173 172
174 p= &(sequence[0]); 173 p= &(sequence[0]);
175 l2n(seq,p); 174 l2n(seq,p);
176 175
177 /* There has to be a MAC algorithm. */ 176 /* There has to be a MAC algorithm. */
178 EVP_MD_CTX_init(&c); 177 EVP_MD_CTX_init(&c);
179 » EVP_DigestInit_ex(&c, s->read_hash, NULL); 178 » EVP_MD_CTX_copy(&c, s->read_hash);
180 EVP_DigestUpdate(&c,sec, 179 EVP_DigestUpdate(&c,sec,
181 EVP_CIPHER_CTX_key_length(s->enc_read_ctx)); 180 EVP_CIPHER_CTX_key_length(s->enc_read_ctx));
182 EVP_DigestUpdate(&c,act,len); 181 EVP_DigestUpdate(&c,act,len);
183 /* the above line also does the pad data */ 182 /* the above line also does the pad data */
184 EVP_DigestUpdate(&c,sequence,4); 183 EVP_DigestUpdate(&c,sequence,4);
185 EVP_DigestFinal_ex(&c,md,NULL); 184 EVP_DigestFinal_ex(&c,md,NULL);
186 EVP_MD_CTX_cleanup(&c); 185 EVP_MD_CTX_cleanup(&c);
187 } 186 }
188 #else /* !OPENSSL_NO_SSL2 */ 187 #else /* !OPENSSL_NO_SSL2 */
189 188
190 # if PEDANTIC 189 # if PEDANTIC
191 static void *dummy=&dummy; 190 static void *dummy=&dummy;
192 # endif 191 # endif
193 192
194 #endif 193 #endif
OLDNEW
« no previous file with comments | « openssl/ssl/s2_clnt.c ('k') | openssl/ssl/s2_lib.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698