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

Side by Side Diff: openssl/ssl/s3_pkt.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/s3_lib.c ('k') | openssl/ssl/ssl.h » ('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_pkt.c */ 1 /* ssl/s3_pkt.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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 eivlen = EVP_CIPHER_CTX_iv_length(s->enc_write_ctx); 766 eivlen = EVP_CIPHER_CTX_iv_length(s->enc_write_ctx);
767 if (eivlen <= 1) 767 if (eivlen <= 1)
768 eivlen = 0; 768 eivlen = 0;
769 } 769 }
770 /* Need explicit part of IV for GCM mode */ 770 /* Need explicit part of IV for GCM mode */
771 else if (mode == EVP_CIPH_GCM_MODE) 771 else if (mode == EVP_CIPH_GCM_MODE)
772 eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; 772 eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN;
773 else 773 else
774 eivlen = 0; 774 eivlen = 0;
775 } 775 }
776 » else 776 » else if (s->aead_write_ctx != NULL &&
777 » » s->aead_write_ctx->variable_nonce_included_in_record)
778 » » {
779 » » eivlen = s->aead_write_ctx->variable_nonce_len;
780 » » }
781 » else
777 eivlen = 0; 782 eivlen = 0;
778 783
779 /* lets setup the record stuff. */ 784 /* lets setup the record stuff. */
780 wr->data=p + eivlen; 785 wr->data=p + eivlen;
781 wr->length=(int)len; 786 wr->length=(int)len;
782 wr->input=(unsigned char *)buf; 787 wr->input=(unsigned char *)buf;
783 788
784 /* we now 'read' from wr->input, wr->length bytes into 789 /* we now 'read' from wr->input, wr->length bytes into
785 * wr->data */ 790 * wr->data */
786 791
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 cb=s->ctx->info_callback; 1519 cb=s->ctx->info_callback;
1515 1520
1516 if (cb != NULL) 1521 if (cb != NULL)
1517 { 1522 {
1518 j=(s->s3->send_alert[0]<<8)|s->s3->send_alert[1]; 1523 j=(s->s3->send_alert[0]<<8)|s->s3->send_alert[1];
1519 cb(s,SSL_CB_WRITE_ALERT,j); 1524 cb(s,SSL_CB_WRITE_ALERT,j);
1520 } 1525 }
1521 } 1526 }
1522 return(i); 1527 return(i);
1523 } 1528 }
OLDNEW
« no previous file with comments | « openssl/ssl/s3_lib.c ('k') | openssl/ssl/ssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698