diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 120 |
1 files changed, 118 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 5681167242..a187c8d77a 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_locl.h,v 1.150 2017/01/22 07:16:39 beck Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.151 2017/01/22 09:02:07 jsing Exp $ */ |
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 | * |
@@ -445,8 +445,125 @@ typedef struct ssl_internal_st { | |||
445 | } SSL_INTERNAL; | 445 | } SSL_INTERNAL; |
446 | 446 | ||
447 | typedef struct ssl3_state_internal_st { | 447 | typedef struct ssl3_state_internal_st { |
448 | int delay_buf_pop_ret; | ||
448 | 449 | ||
450 | unsigned char read_sequence[SSL3_SEQUENCE_SIZE]; | ||
451 | int read_mac_secret_size; | ||
452 | unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; | ||
453 | unsigned char write_sequence[SSL3_SEQUENCE_SIZE]; | ||
454 | int write_mac_secret_size; | ||
455 | unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; | ||
456 | |||
457 | /* flags for countermeasure against known-IV weakness */ | ||
458 | int need_empty_fragments; | ||
459 | int empty_fragment_done; | ||
460 | |||
461 | SSL3_RECORD rrec; /* each decoded record goes in here */ | ||
462 | SSL3_RECORD wrec; /* goes out from here */ | ||
463 | |||
464 | /* storage for Alert/Handshake protocol data received but not | ||
465 | * yet processed by ssl3_read_bytes: */ | ||
466 | unsigned char alert_fragment[2]; | ||
467 | unsigned int alert_fragment_len; | ||
468 | unsigned char handshake_fragment[4]; | ||
469 | unsigned int handshake_fragment_len; | ||
470 | |||
471 | /* partial write - check the numbers match */ | ||
472 | unsigned int wnum; /* number of bytes sent so far */ | ||
473 | int wpend_tot; /* number bytes written */ | ||
474 | int wpend_type; | ||
475 | int wpend_ret; /* number of bytes submitted */ | ||
476 | const unsigned char *wpend_buf; | ||
477 | |||
478 | /* used during startup, digest all incoming/outgoing packets */ | ||
479 | BIO *handshake_buffer; | ||
480 | /* When set of handshake digests is determined, buffer is hashed | ||
481 | * and freed and MD_CTX-es for all required digests are stored in | ||
482 | * this array */ | ||
483 | EVP_MD_CTX **handshake_dgst; | ||
484 | /* this is set whenerver we see a change_cipher_spec message | ||
485 | * come in when we are not looking for one */ | ||
486 | int change_cipher_spec; | ||
487 | |||
488 | int warn_alert; | ||
489 | int fatal_alert; | ||
490 | |||
491 | /* This flag is set when we should renegotiate ASAP, basically when | ||
492 | * there is no more data in the read or write buffers */ | ||
493 | int renegotiate; | ||
494 | int total_renegotiations; | ||
495 | int num_renegotiations; | ||
496 | |||
497 | int in_read_app_data; | ||
498 | |||
499 | struct { | ||
500 | /* actually only needs to be 16+20 */ | ||
501 | unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; | ||
502 | |||
503 | /* actually only need to be 16+20 for SSLv3 and 12 for TLS */ | ||
504 | unsigned char finish_md[EVP_MAX_MD_SIZE*2]; | ||
505 | int finish_md_len; | ||
506 | unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; | ||
507 | int peer_finish_md_len; | ||
508 | |||
509 | unsigned long message_size; | ||
510 | int message_type; | ||
511 | |||
512 | /* used to hold the new cipher we are going to use */ | ||
513 | const SSL_CIPHER *new_cipher; | ||
514 | DH *dh; | ||
515 | |||
516 | EC_KEY *ecdh; /* holds short lived ECDH key */ | ||
517 | |||
518 | uint8_t *x25519; | ||
519 | |||
520 | /* used when SSL_ST_FLUSH_DATA is entered */ | ||
521 | int next_state; | ||
522 | |||
523 | int reuse_message; | ||
524 | |||
525 | /* used for certificate requests */ | ||
526 | int cert_req; | ||
527 | int ctype_num; | ||
528 | char ctype[SSL3_CT_NUMBER]; | ||
529 | STACK_OF(X509_NAME) *ca_names; | ||
530 | |||
531 | int key_block_length; | ||
532 | unsigned char *key_block; | ||
533 | |||
534 | const EVP_CIPHER *new_sym_enc; | ||
535 | const EVP_AEAD *new_aead; | ||
536 | const EVP_MD *new_hash; | ||
537 | int new_mac_pkey_type; | ||
538 | int cert_request; | ||
539 | } tmp; | ||
540 | |||
541 | /* Connection binding to prevent renegotiation attacks */ | ||
542 | unsigned char previous_client_finished[EVP_MAX_MD_SIZE]; | ||
543 | unsigned char previous_client_finished_len; | ||
544 | unsigned char previous_server_finished[EVP_MAX_MD_SIZE]; | ||
545 | unsigned char previous_server_finished_len; | ||
546 | int send_connection_binding; /* TODOEKR */ | ||
547 | |||
548 | /* Set if we saw the Next Protocol Negotiation extension from our peer. | ||
549 | */ | ||
550 | int next_proto_neg_seen; | ||
551 | |||
552 | /* | ||
553 | * ALPN information | ||
554 | * (we are in the process of transitioning from NPN to ALPN). | ||
555 | */ | ||
556 | |||
557 | /* | ||
558 | * In a server these point to the selected ALPN protocol after the | ||
559 | * ClientHello has been processed. In a client these contain the | ||
560 | * protocol that the server selected once the ServerHello has been | ||
561 | * processed. | ||
562 | */ | ||
563 | unsigned char *alpn_selected; | ||
564 | unsigned int alpn_selected_len; | ||
449 | } SSL3_STATE_INTERNAL; | 565 | } SSL3_STATE_INTERNAL; |
566 | #define S3I(s) (s->s3->internal) | ||
450 | 567 | ||
451 | typedef struct dtls1_state_internal_st { | 568 | typedef struct dtls1_state_internal_st { |
452 | unsigned int send_cookie; | 569 | unsigned int send_cookie; |
@@ -564,7 +681,6 @@ typedef struct sess_cert_st { | |||
564 | int references; /* actually always 1 at the moment */ | 681 | int references; /* actually always 1 at the moment */ |
565 | } SESS_CERT; | 682 | } SESS_CERT; |
566 | 683 | ||
567 | |||
568 | /*#define SSL_DEBUG */ | 684 | /*#define SSL_DEBUG */ |
569 | /*#define RSA_DEBUG */ | 685 | /*#define RSA_DEBUG */ |
570 | 686 | ||