aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/tls/gnutls_constate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/tls/gnutls_constate.c')
-rw-r--r--src/daemon/https/tls/gnutls_constate.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/src/daemon/https/tls/gnutls_constate.c b/src/daemon/https/tls/gnutls_constate.c
index 41167f79..845abfe9 100644
--- a/src/daemon/https/tls/gnutls_constate.c
+++ b/src/daemon/https/tls/gnutls_constate.c
@@ -105,9 +105,10 @@ MHD__gnutls_set_keys (MHD_gtls_session_t session, int hash_size, int IV_size,
105 { /* TLS 1.0 */ 105 { /* TLS 1.0 */
106 ret = 106 ret =
107 MHD_gtls_PRF (session, 107 MHD_gtls_PRF (session,
108 (const unsigned char *) session->security_parameters. 108 (const unsigned char *) session->
109 master_secret, TLS_MASTER_SIZE, keyexp, keyexp_length, 109 security_parameters.master_secret, TLS_MASTER_SIZE,
110 rnd, 2 * TLS_RANDOM_SIZE, block_size, key_block); 110 keyexp, keyexp_length, rnd, 2 * TLS_RANDOM_SIZE,
111 block_size, key_block);
111 } 112 }
112 113
113 if (ret < 0) 114 if (ret < 0)
@@ -506,35 +507,35 @@ MHD_gtls_read_connection_state_init (MHD_gtls_session_t session)
506 { 507 {
507 rc = MHD_gtls_set_read_cipher (session, 508 rc = MHD_gtls_set_read_cipher (session,
508 MHD_gtls_cipher_suite_get_cipher_algo 509 MHD_gtls_cipher_suite_get_cipher_algo
509 (&session-> 510 (&session->security_parameters.
510 security_parameters.current_cipher_suite)); 511 current_cipher_suite));
511 if (rc < 0) 512 if (rc < 0)
512 return rc; 513 return rc;
513 rc = MHD_gtls_set_read_mac (session, 514 rc = MHD_gtls_set_read_mac (session,
514 MHD_gtls_cipher_suite_get_mac_algo 515 MHD_gtls_cipher_suite_get_mac_algo
515 (&session-> 516 (&session->security_parameters.
516 security_parameters.current_cipher_suite)); 517 current_cipher_suite));
517 if (rc < 0) 518 if (rc < 0)
518 return rc; 519 return rc;
519 520
520 rc = MHD_gtls_set_kx (session, 521 rc = MHD_gtls_set_kx (session,
521 MHD_gtls_cipher_suite_get_kx_algo 522 MHD_gtls_cipher_suite_get_kx_algo
522 (&session-> 523 (&session->security_parameters.
523 security_parameters.current_cipher_suite)); 524 current_cipher_suite));
524 if (rc < 0) 525 if (rc < 0)
525 return rc; 526 return rc;
526 527
527 rc = MHD_gtls_set_read_compression (session, 528 rc = MHD_gtls_set_read_compression (session,
528 session-> 529 session->internals.
529 internals.compression_method); 530 compression_method);
530 if (rc < 0) 531 if (rc < 0)
531 return rc; 532 return rc;
532 } 533 }
533 else 534 else
534 { /* RESUME_TRUE */ 535 { /* RESUME_TRUE */
535 MHD__gnutls_cpy_read_security_parameters (&session->security_parameters, 536 MHD__gnutls_cpy_read_security_parameters (&session->security_parameters,
536 &session-> 537 &session->internals.
537 internals.resumed_security_parameters); 538 resumed_security_parameters);
538 } 539 }
539 540
540 541
@@ -545,8 +546,8 @@ MHD_gtls_read_connection_state_init (MHD_gtls_session_t session)
545 MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", 546 MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n",
546 session, 547 session,
547 MHD_gtls_cipher_suite_get_name 548 MHD_gtls_cipher_suite_get_name
548 (&session-> 549 (&session->security_parameters.
549 security_parameters.current_cipher_suite)); 550 current_cipher_suite));
550 551
551 if (MHD_gtls_compression_is_ok 552 if (MHD_gtls_compression_is_ok
552 (session->security_parameters.read_compression_algorithm) != 0) 553 (session->security_parameters.read_compression_algorithm) != 0)
@@ -571,8 +572,8 @@ MHD_gtls_read_connection_state_init (MHD_gtls_session_t session)
571 MHD_gnutls_cipher_deinit (session->connection_state.read_cipher_state); 572 MHD_gnutls_cipher_deinit (session->connection_state.read_cipher_state);
572 573
573 mac_size = 574 mac_size =
574 MHD_gnutls_hash_get_algo_len (session-> 575 MHD_gnutls_hash_get_algo_len (session->security_parameters.
575 security_parameters.read_mac_algorithm); 576 read_mac_algorithm);
576 577
577 MHD__gnutls_handshake_log 578 MHD__gnutls_handshake_log
578 ("HSK[%x]: Initializing internal [read] cipher sessions\n", session); 579 ("HSK[%x]: Initializing internal [read] cipher sessions\n", session);
@@ -583,8 +584,8 @@ MHD_gtls_read_connection_state_init (MHD_gtls_session_t session)
583 /* initialize cipher session 584 /* initialize cipher session
584 */ 585 */
585 session->connection_state.read_cipher_state = 586 session->connection_state.read_cipher_state =
586 MHD_gtls_cipher_init (session-> 587 MHD_gtls_cipher_init (session->security_parameters.
587 security_parameters.read_bulk_cipher_algorithm, 588 read_bulk_cipher_algorithm,
588 &session->cipher_specs.client_write_key, 589 &session->cipher_specs.client_write_key,
589 &session->cipher_specs.client_write_IV); 590 &session->cipher_specs.client_write_IV);
590 if (session->connection_state.read_cipher_state == GNUTLS_CIPHER_FAILED 591 if (session->connection_state.read_cipher_state == GNUTLS_CIPHER_FAILED
@@ -615,8 +616,8 @@ MHD_gtls_read_connection_state_init (MHD_gtls_session_t session)
615#if MHD_DEBUG_TLS 616#if MHD_DEBUG_TLS
616 case GNUTLS_CLIENT: 617 case GNUTLS_CLIENT:
617 session->connection_state.read_cipher_state = 618 session->connection_state.read_cipher_state =
618 MHD_gtls_cipher_init (session-> 619 MHD_gtls_cipher_init (session->security_parameters.
619 security_parameters.read_bulk_cipher_algorithm, 620 read_bulk_cipher_algorithm,
620 &session->cipher_specs.server_write_key, 621 &session->cipher_specs.server_write_key,
621 &session->cipher_specs.server_write_IV); 622 &session->cipher_specs.server_write_IV);
622 623
@@ -674,27 +675,27 @@ MHD_gtls_write_connection_state_init (MHD_gtls_session_t session)
674 { 675 {
675 rc = MHD_gtls_set_write_cipher (session, 676 rc = MHD_gtls_set_write_cipher (session,
676 MHD_gtls_cipher_suite_get_cipher_algo 677 MHD_gtls_cipher_suite_get_cipher_algo
677 (&session-> 678 (&session->security_parameters.
678 security_parameters.current_cipher_suite)); 679 current_cipher_suite));
679 if (rc < 0) 680 if (rc < 0)
680 return rc; 681 return rc;
681 rc = MHD_gtls_set_write_mac (session, 682 rc = MHD_gtls_set_write_mac (session,
682 MHD_gtls_cipher_suite_get_mac_algo 683 MHD_gtls_cipher_suite_get_mac_algo
683 (&session-> 684 (&session->security_parameters.
684 security_parameters.current_cipher_suite)); 685 current_cipher_suite));
685 if (rc < 0) 686 if (rc < 0)
686 return rc; 687 return rc;
687 688
688 rc = MHD_gtls_set_kx (session, 689 rc = MHD_gtls_set_kx (session,
689 MHD_gtls_cipher_suite_get_kx_algo 690 MHD_gtls_cipher_suite_get_kx_algo
690 (&session-> 691 (&session->security_parameters.
691 security_parameters.current_cipher_suite)); 692 current_cipher_suite));
692 if (rc < 0) 693 if (rc < 0)
693 return rc; 694 return rc;
694 695
695 rc = MHD_gtls_set_write_compression (session, 696 rc = MHD_gtls_set_write_compression (session,
696 session-> 697 session->internals.
697 internals.compression_method); 698 compression_method);
698 if (rc < 0) 699 if (rc < 0)
699 return rc; 700 return rc;
700 } 701 }
@@ -711,8 +712,8 @@ MHD_gtls_write_connection_state_init (MHD_gtls_session_t session)
711 712
712 MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", session, 713 MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", session,
713 MHD_gtls_cipher_suite_get_name 714 MHD_gtls_cipher_suite_get_name
714 (&session-> 715 (&session->security_parameters.
715 security_parameters.current_cipher_suite)); 716 current_cipher_suite));
716 717
717 if (MHD_gtls_compression_is_ok 718 if (MHD_gtls_compression_is_ok
718 (session->security_parameters.write_compression_algorithm) != 0) 719 (session->security_parameters.write_compression_algorithm) != 0)
@@ -739,8 +740,8 @@ MHD_gtls_write_connection_state_init (MHD_gtls_session_t session)
739 MHD_gnutls_cipher_deinit (session->connection_state.write_cipher_state); 740 MHD_gnutls_cipher_deinit (session->connection_state.write_cipher_state);
740 741
741 mac_size = 742 mac_size =
742 MHD_gnutls_hash_get_algo_len (session-> 743 MHD_gnutls_hash_get_algo_len (session->security_parameters.
743 security_parameters.write_mac_algorithm); 744 write_mac_algorithm);
744 745
745 MHD__gnutls_handshake_log 746 MHD__gnutls_handshake_log
746 ("HSK[%x]: Initializing internal [write] cipher sessions\n", session); 747 ("HSK[%x]: Initializing internal [write] cipher sessions\n", session);
@@ -751,8 +752,8 @@ MHD_gtls_write_connection_state_init (MHD_gtls_session_t session)
751 /* initialize cipher session 752 /* initialize cipher session
752 */ 753 */
753 session->connection_state.write_cipher_state = 754 session->connection_state.write_cipher_state =
754 MHD_gtls_cipher_init (session-> 755 MHD_gtls_cipher_init (session->security_parameters.
755 security_parameters.write_bulk_cipher_algorithm, 756 write_bulk_cipher_algorithm,
756 &session->cipher_specs.server_write_key, 757 &session->cipher_specs.server_write_key,
757 &session->cipher_specs.server_write_IV); 758 &session->cipher_specs.server_write_IV);
758 759
@@ -787,8 +788,8 @@ MHD_gtls_write_connection_state_init (MHD_gtls_session_t session)
787#if MHD_DEBUG_TLS 788#if MHD_DEBUG_TLS
788 case GNUTLS_CLIENT: 789 case GNUTLS_CLIENT:
789 session->connection_state.write_cipher_state = 790 session->connection_state.write_cipher_state =
790 MHD_gtls_cipher_init (session-> 791 MHD_gtls_cipher_init (session->security_parameters.
791 security_parameters.write_bulk_cipher_algorithm, 792 write_bulk_cipher_algorithm,
792 &session->cipher_specs.client_write_key, 793 &session->cipher_specs.client_write_key,
793 &session->cipher_specs.client_write_IV); 794 &session->cipher_specs.client_write_IV);
794 795