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

Side by Side Diff: openssl/ssl/s3_enc.c

Issue 59083010: third_party/openssl: add ChaCha20+Poly1305 support. Base URL: https://chromium.googlesource.com/chromium/deps/openssl.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « openssl/ssl/s2_srvr.c ('k') | openssl/ssl/s3_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/s3_enc.c */ 1 /* ssl/s3_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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 unsigned char *p; 390 unsigned char *p;
391 const EVP_CIPHER *c; 391 const EVP_CIPHER *c;
392 const EVP_MD *hash; 392 const EVP_MD *hash;
393 int num; 393 int num;
394 int ret = 0; 394 int ret = 0;
395 SSL_COMP *comp; 395 SSL_COMP *comp;
396 396
397 if (s->s3->tmp.key_block_length != 0) 397 if (s->s3->tmp.key_block_length != 0)
398 return(1); 398 return(1);
399 399
400 » if (!ssl_cipher_get_evp(s->session,&c,&hash,NULL,NULL,&comp)) 400 » if (!ssl_cipher_get_comp(s->session, &comp))
401 { 401 {
402 SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK,SSL_R_CIPHER_OR_HASH_UNAVAILAB LE); 402 SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK,SSL_R_CIPHER_OR_HASH_UNAVAILAB LE);
403 return(0); 403 return(0);
404 }
405
406 if (!ssl_cipher_get_evp(s->session,&c,&hash,NULL,NULL))
407 {
408 SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK,SSL_R_CIPHER_OR_HASH_UNAVAILAB LE);
409 return(0);
404 } 410 }
405 411
406 s->s3->tmp.new_sym_enc=c; 412 s->s3->tmp.new_sym_enc=c;
407 s->s3->tmp.new_hash=hash; 413 s->s3->tmp.new_hash=hash;
408 #ifdef OPENSSL_NO_COMP 414 #ifdef OPENSSL_NO_COMP
409 s->s3->tmp.new_compression=NULL; 415 s->s3->tmp.new_compression=NULL;
410 #else 416 #else
411 s->s3->tmp.new_compression=comp; 417 s->s3->tmp.new_compression=comp;
412 #endif 418 #endif
413 419
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 case SSL_AD_UNSUPPORTED_EXTENSION: return(SSL3_AD_HANDSHAKE_FAILURE); 895 case SSL_AD_UNSUPPORTED_EXTENSION: return(SSL3_AD_HANDSHAKE_FAILURE);
890 case SSL_AD_CERTIFICATE_UNOBTAINABLE: return(SSL3_AD_HANDSHAKE_FAILURE); 896 case SSL_AD_CERTIFICATE_UNOBTAINABLE: return(SSL3_AD_HANDSHAKE_FAILURE);
891 case SSL_AD_UNRECOGNIZED_NAME: return(SSL3_AD_HANDSHAKE_FAILURE); 897 case SSL_AD_UNRECOGNIZED_NAME: return(SSL3_AD_HANDSHAKE_FAILURE);
892 case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE: return(SSL3_AD_HANDSHAKE_FA ILURE); 898 case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE: return(SSL3_AD_HANDSHAKE_FA ILURE);
893 case SSL_AD_BAD_CERTIFICATE_HASH_VALUE: return(SSL3_AD_HANDSHAKE_FAILURE ); 899 case SSL_AD_BAD_CERTIFICATE_HASH_VALUE: return(SSL3_AD_HANDSHAKE_FAILURE );
894 case SSL_AD_UNKNOWN_PSK_IDENTITY:return(TLS1_AD_UNKNOWN_PSK_IDENTITY); 900 case SSL_AD_UNKNOWN_PSK_IDENTITY:return(TLS1_AD_UNKNOWN_PSK_IDENTITY);
895 default: return(-1); 901 default: return(-1);
896 } 902 }
897 } 903 }
898 904
OLDNEW
« no previous file with comments | « openssl/ssl/s2_srvr.c ('k') | openssl/ssl/s3_lib.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698