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

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

Issue 35493002: Update Channel ID API to use a callback. (Closed) 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/include/openssl/ssl.h ('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_clnt.c */ 1 /* ssl/s3_clnt.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 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3407 unsigned char *d; 3407 unsigned char *d;
3408 int ret = -1, public_key_len; 3408 int ret = -1, public_key_len;
3409 EVP_MD_CTX md_ctx; 3409 EVP_MD_CTX md_ctx;
3410 size_t sig_len; 3410 size_t sig_len;
3411 ECDSA_SIG *sig = NULL; 3411 ECDSA_SIG *sig = NULL;
3412 unsigned char *public_key = NULL, *derp, *der_sig = NULL; 3412 unsigned char *public_key = NULL, *derp, *der_sig = NULL;
3413 3413
3414 if (s->state != SSL3_ST_CW_CHANNEL_ID_A) 3414 if (s->state != SSL3_ST_CW_CHANNEL_ID_A)
3415 return ssl3_do_write(s, SSL3_RT_HANDSHAKE); 3415 return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
3416 3416
3417 if (s->tlsext_channel_id_private == NULL) 3417 » if (!s->tlsext_channel_id_private && s->ctx->channel_id_cb)
3418 { 3418 » » {
3419 s->rwstate=SSL_CHANNEL_ID_LOOKUP; 3419 » » EVP_PKEY* key = NULL;
agl 2013/10/22 20:00:17 * on the right in OpenSSL.
3420 return (-1); 3420 » » s->ctx->channel_id_cb(s, &key);
3421 } 3421 » » if (key != NULL)
3422 s->rwstate=SSL_NOTHING; 3422 » » » {
3423 » » » s->tlsext_channel_id_private = EVP_PKEY_dup(key);
3424 » » » }
3425 » » }
3426 » if (!s->tlsext_channel_id_private)
3427 » » {
3428 » » s->rwstate=SSL_CHANNEL_ID_LOOKUP;
3429 » » return (-1);
3430 » » }
3431 » s->rwstate=SSL_NOTHING;
3423 3432
3424 d = (unsigned char *)s->init_buf->data; 3433 d = (unsigned char *)s->init_buf->data;
3425 *(d++)=SSL3_MT_ENCRYPTED_EXTENSIONS; 3434 *(d++)=SSL3_MT_ENCRYPTED_EXTENSIONS;
3426 l2n3(2 + 2 + TLSEXT_CHANNEL_ID_SIZE, d); 3435 l2n3(2 + 2 + TLSEXT_CHANNEL_ID_SIZE, d);
3427 s2n(TLSEXT_TYPE_channel_id, d); 3436 s2n(TLSEXT_TYPE_channel_id, d);
3428 s2n(TLSEXT_CHANNEL_ID_SIZE, d); 3437 s2n(TLSEXT_CHANNEL_ID_SIZE, d);
3429 3438
3430 EVP_MD_CTX_init(&md_ctx); 3439 EVP_MD_CTX_init(&md_ctx);
3431 3440
3432 public_key_len = i2d_PublicKey(s->tlsext_channel_id_private, NULL); 3441 public_key_len = i2d_PublicKey(s->tlsext_channel_id_private, NULL);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
3559 SSL_get_client_CA_list(s), 3568 SSL_get_client_CA_list(s),
3560 px509, ppkey, NULL, NULL, NULL); 3569 px509, ppkey, NULL, NULL, NULL);
3561 if (i != 0) 3570 if (i != 0)
3562 return i; 3571 return i;
3563 } 3572 }
3564 #endif 3573 #endif
3565 if (s->ctx->client_cert_cb) 3574 if (s->ctx->client_cert_cb)
3566 i = s->ctx->client_cert_cb(s,px509,ppkey); 3575 i = s->ctx->client_cert_cb(s,px509,ppkey);
3567 return i; 3576 return i;
3568 } 3577 }
OLDNEW
« no previous file with comments | « openssl/include/openssl/ssl.h ('k') | openssl/ssl/ssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698