diff options
Diffstat (limited to 'src/daemon/https/tls/gnutls_cipher.c')
-rw-r--r-- | src/daemon/https/tls/gnutls_cipher.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/daemon/https/tls/gnutls_cipher.c b/src/daemon/https/tls/gnutls_cipher.c index b919aea0..6edc0efe 100644 --- a/src/daemon/https/tls/gnutls_cipher.c +++ b/src/daemon/https/tls/gnutls_cipher.c | |||
@@ -212,15 +212,15 @@ MHD_gtls_compressed2ciphertext (MHD_gtls_session_t session, | |||
212 | uint8_t type = _type; | 212 | uint8_t type = _type; |
213 | uint8_t major, minor; | 213 | uint8_t major, minor; |
214 | int hash_size = | 214 | int hash_size = |
215 | MHD_gnutls_hash_get_algo_len (session-> | 215 | MHD_gnutls_hash_get_algo_len (session->security_parameters. |
216 | security_parameters.write_mac_algorithm); | 216 | write_mac_algorithm); |
217 | enum MHD_GNUTLS_Protocol ver; | 217 | enum MHD_GNUTLS_Protocol ver; |
218 | int blocksize = | 218 | int blocksize = |
219 | MHD_gtls_cipher_get_block_size (session-> | 219 | MHD_gtls_cipher_get_block_size (session->security_parameters. |
220 | security_parameters.write_bulk_cipher_algorithm); | 220 | write_bulk_cipher_algorithm); |
221 | cipher_type_t block_algo = | 221 | cipher_type_t block_algo = |
222 | MHD_gtls_cipher_is_block (session-> | 222 | MHD_gtls_cipher_is_block (session->security_parameters. |
223 | security_parameters.write_bulk_cipher_algorithm); | 223 | write_bulk_cipher_algorithm); |
224 | opaque *data_ptr; | 224 | opaque *data_ptr; |
225 | 225 | ||
226 | 226 | ||
@@ -247,9 +247,8 @@ MHD_gtls_compressed2ciphertext (MHD_gtls_session_t session, | |||
247 | if (td != GNUTLS_MAC_FAILED) | 247 | if (td != GNUTLS_MAC_FAILED) |
248 | { /* actually when the algorithm in not the NULL one */ | 248 | { /* actually when the algorithm in not the NULL one */ |
249 | MHD_gnutls_hash (td, | 249 | MHD_gnutls_hash (td, |
250 | UINT64DATA (session-> | 250 | UINT64DATA (session->connection_state. |
251 | connection_state.write_sequence_number), | 251 | write_sequence_number), 8); |
252 | 8); | ||
253 | 252 | ||
254 | MHD_gnutls_hash (td, &type, 1); | 253 | MHD_gnutls_hash (td, &type, 1); |
255 | if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0) | 254 | if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0) |
@@ -343,16 +342,16 @@ MHD_gtls_ciphertext2compressed (MHD_gtls_session_t session, | |||
343 | uint8_t major, minor; | 342 | uint8_t major, minor; |
344 | enum MHD_GNUTLS_Protocol ver; | 343 | enum MHD_GNUTLS_Protocol ver; |
345 | int hash_size = | 344 | int hash_size = |
346 | MHD_gnutls_hash_get_algo_len (session-> | 345 | MHD_gnutls_hash_get_algo_len (session->security_parameters. |
347 | security_parameters.read_mac_algorithm); | 346 | read_mac_algorithm); |
348 | 347 | ||
349 | ver = MHD__gnutls_protocol_get_version (session); | 348 | ver = MHD__gnutls_protocol_get_version (session); |
350 | minor = MHD_gtls_version_get_minor (ver); | 349 | minor = MHD_gtls_version_get_minor (ver); |
351 | major = MHD_gtls_version_get_major (ver); | 350 | major = MHD_gtls_version_get_major (ver); |
352 | 351 | ||
353 | blocksize = | 352 | blocksize = |
354 | MHD_gtls_cipher_get_block_size (session-> | 353 | MHD_gtls_cipher_get_block_size (session->security_parameters. |
355 | security_parameters.read_bulk_cipher_algorithm); | 354 | read_bulk_cipher_algorithm); |
356 | 355 | ||
357 | /* initialize MAC | 356 | /* initialize MAC |
358 | */ | 357 | */ |
@@ -376,9 +375,9 @@ MHD_gtls_ciphertext2compressed (MHD_gtls_session_t session, | |||
376 | { | 375 | { |
377 | case CIPHER_STREAM: | 376 | case CIPHER_STREAM: |
378 | if ((ret = | 377 | if ((ret = |
379 | MHD_gtls_cipher_decrypt (session-> | 378 | MHD_gtls_cipher_decrypt (session->connection_state. |
380 | connection_state.read_cipher_state, | 379 | read_cipher_state, ciphertext.data, |
381 | ciphertext.data, ciphertext.size)) < 0) | 380 | ciphertext.size)) < 0) |
382 | { | 381 | { |
383 | MHD_gnutls_assert (); | 382 | MHD_gnutls_assert (); |
384 | return ret; | 383 | return ret; |
@@ -395,9 +394,9 @@ MHD_gtls_ciphertext2compressed (MHD_gtls_session_t session, | |||
395 | } | 394 | } |
396 | 395 | ||
397 | if ((ret = | 396 | if ((ret = |
398 | MHD_gtls_cipher_decrypt (session-> | 397 | MHD_gtls_cipher_decrypt (session->connection_state. |
399 | connection_state.read_cipher_state, | 398 | read_cipher_state, ciphertext.data, |
400 | ciphertext.data, ciphertext.size)) < 0) | 399 | ciphertext.size)) < 0) |
401 | { | 400 | { |
402 | MHD_gnutls_assert (); | 401 | MHD_gnutls_assert (); |
403 | return ret; | 402 | return ret; |
@@ -455,8 +454,8 @@ MHD_gtls_ciphertext2compressed (MHD_gtls_session_t session, | |||
455 | if (td != GNUTLS_MAC_FAILED) | 454 | if (td != GNUTLS_MAC_FAILED) |
456 | { | 455 | { |
457 | MHD_gnutls_hash (td, | 456 | MHD_gnutls_hash (td, |
458 | UINT64DATA (session-> | 457 | UINT64DATA (session->connection_state. |
459 | connection_state.read_sequence_number), 8); | 458 | read_sequence_number), 8); |
460 | 459 | ||
461 | MHD_gnutls_hash (td, &type, 1); | 460 | MHD_gnutls_hash (td, &type, 1); |
462 | if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0) | 461 | if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0) |