diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-05-24 16:06:29 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-05-24 16:06:29 +0000 |
commit | 4e6023a761b71077c7a9306f14896e1fe11d7f93 (patch) | |
tree | 2b29aa767972f6ff6ff695517b640c0d96359ab3 /lib | |
parent | a9595b3062fc95ea14e704a742acb68c14c419b8 (diff) |
Use C99 initialisers for SSL3_ENC_METHOD structs.
ok miod@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/d1_lib.c | 26 | ||||
-rw-r--r-- | lib/libssl/s3_lib.c | 30 | ||||
-rw-r--r-- | lib/libssl/ssl_lib.c | 35 | ||||
-rw-r--r-- | lib/libssl/t1_lib.c | 26 |
4 files changed, 63 insertions, 54 deletions
diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c index a2500ee0bf9..199653624c4 100644 --- a/lib/libssl/d1_lib.c +++ b/lib/libssl/d1_lib.c @@ -72,18 +72,20 @@ const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; int dtls1_listen(SSL *s, struct sockaddr *client); SSL3_ENC_METHOD DTLSv1_enc_data = { - dtls1_enc, - tls1_mac, - tls1_setup_key_block, - tls1_generate_master_secret, - tls1_change_cipher_state, - tls1_final_finish_mac, - TLS1_FINISH_MAC_LENGTH, - tls1_cert_verify_mac, - TLS_MD_CLIENT_FINISH_CONST, TLS_MD_CLIENT_FINISH_CONST_SIZE, - TLS_MD_SERVER_FINISH_CONST, TLS_MD_SERVER_FINISH_CONST_SIZE, - tls1_alert_code, - tls1_export_keying_material, + .enc = dtls1_enc, + .mac = tls1_mac, + .setup_key_block = tls1_setup_key_block, + .generate_master_secret = tls1_generate_master_secret, + .change_cipher_state = tls1_change_cipher_state, + .final_finish_mac = tls1_final_finish_mac, + .finish_mac_length = TLS1_FINISH_MAC_LENGTH, + .cert_verify_mac = tls1_cert_verify_mac, + .client_finished_label = TLS_MD_CLIENT_FINISH_CONST, + .client_finished_label_len = TLS_MD_CLIENT_FINISH_CONST_SIZE, + .server_finished_label = TLS_MD_SERVER_FINISH_CONST, + .server_finished_label_len = TLS_MD_SERVER_FINISH_CONST_SIZE, + .alert_value = tls1_alert_code, + .export_keying_material = tls1_export_keying_material, }; long diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index f14cbd0c99c..1a0bb5195d8 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -2254,20 +2254,22 @@ SSL_CIPHER ssl3_ciphers[] = { }; SSL3_ENC_METHOD SSLv3_enc_data = { - ssl3_enc, - n_ssl3_mac, - ssl3_setup_key_block, - ssl3_generate_master_secret, - ssl3_change_cipher_state, - ssl3_final_finish_mac, - MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, - ssl3_cert_verify_mac, - SSL3_MD_CLIENT_FINISHED_CONST, 4, - SSL3_MD_SERVER_FINISHED_CONST, 4, - ssl3_alert_code, - (int (*)(SSL *, unsigned char *, size_t, const char *, - size_t, const unsigned char *, size_t, - int use_context))ssl_undefined_function, + .enc = ssl3_enc, + .mac = n_ssl3_mac, + .setup_key_block = ssl3_setup_key_block, + .generate_master_secret = ssl3_generate_master_secret, + .change_cipher_state = ssl3_change_cipher_state, + .final_finish_mac = ssl3_final_finish_mac, + .finish_mac_length = MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, + .cert_verify_mac = ssl3_cert_verify_mac, + .client_finished_label = SSL3_MD_CLIENT_FINISHED_CONST, + .client_finished_label_len = 4, + .server_finished_label = SSL3_MD_SERVER_FINISHED_CONST, + .server_finished_label_len = 4, + .alert_value = ssl3_alert_code, + .export_keying_material = (int (*)(SSL *, unsigned char *, size_t, + const char *, size_t, const unsigned char *, size_t, + int use_context))ssl_undefined_function, }; long diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index 847fb79f6ec..c2e6b407c50 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -163,22 +163,25 @@ SSL3_ENC_METHOD ssl3_undef_enc_method = { * Evil casts, but these functions are only called if there's a * library bug. */ - (int (*)(SSL *, int))ssl_undefined_function, - (int (*)(SSL *, unsigned char *, int))ssl_undefined_function, - ssl_undefined_function, - (int (*)(SSL *, unsigned char *, unsigned char *, int))ssl_undefined_function, - (int (*)(SSL*, int))ssl_undefined_function, - (int (*)(SSL *, const char*, int, unsigned char *))ssl_undefined_function, - 0, /* finish_mac_length */ - (int (*)(SSL *, int, unsigned char *))ssl_undefined_function, - NULL, /* client_finished_label */ - 0, /* client_finished_label_len */ - NULL, /* server_finished_label */ - 0, /* server_finished_label_len */ - (int (*)(int))ssl_undefined_function, - (int (*)(SSL *, unsigned char *, size_t, const char *, - size_t, const unsigned char *, size_t, - int use_context)) ssl_undefined_function, + .enc = (int (*)(SSL *, int))ssl_undefined_function, + .mac = (int (*)(SSL *, unsigned char *, int))ssl_undefined_function, + .setup_key_block = ssl_undefined_function, + .generate_master_secret = (int (*)(SSL *, unsigned char *, + unsigned char *, int))ssl_undefined_function, + .change_cipher_state = (int (*)(SSL*, int))ssl_undefined_function, + .final_finish_mac = (int (*)(SSL *, const char*, int, + unsigned char *))ssl_undefined_function, + .finish_mac_length = 0, + .cert_verify_mac = (int (*)(SSL *, int, + unsigned char *))ssl_undefined_function, + .client_finished_label = NULL, + .client_finished_label_len = 0, + .server_finished_label = NULL, + .server_finished_label_len = 0, + .alert_value = (int (*)(int))ssl_undefined_function, + .export_keying_material = (int (*)(SSL *, unsigned char *, size_t, + const char *, size_t, const unsigned char *, size_t, + int use_context))ssl_undefined_function, }; int diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c index 63537888ae1..0ea9ce752d2 100644 --- a/lib/libssl/t1_lib.c +++ b/lib/libssl/t1_lib.c @@ -126,18 +126,20 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *tick, int ticklen, #endif SSL3_ENC_METHOD TLSv1_enc_data = { - tls1_enc, - tls1_mac, - tls1_setup_key_block, - tls1_generate_master_secret, - tls1_change_cipher_state, - tls1_final_finish_mac, - TLS1_FINISH_MAC_LENGTH, - tls1_cert_verify_mac, - TLS_MD_CLIENT_FINISH_CONST, TLS_MD_CLIENT_FINISH_CONST_SIZE, - TLS_MD_SERVER_FINISH_CONST, TLS_MD_SERVER_FINISH_CONST_SIZE, - tls1_alert_code, - tls1_export_keying_material, + .enc = tls1_enc, + .mac = tls1_mac, + .setup_key_block = tls1_setup_key_block, + .generate_master_secret = tls1_generate_master_secret, + .change_cipher_state = tls1_change_cipher_state, + .final_finish_mac = tls1_final_finish_mac, + .finish_mac_length = TLS1_FINISH_MAC_LENGTH, + .cert_verify_mac = tls1_cert_verify_mac, + .client_finished_label = TLS_MD_CLIENT_FINISH_CONST, + .client_finished_label_len = TLS_MD_CLIENT_FINISH_CONST_SIZE, + .server_finished_label = TLS_MD_SERVER_FINISH_CONST, + .server_finished_label_len = TLS_MD_SERVER_FINISH_CONST_SIZE, + .alert_value = tls1_alert_code, + .export_keying_material = tls1_export_keying_material, }; long |