Use consistent function naming.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 19 Aug 2014 12:54:38 +0000 (13:54 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 28 Aug 2014 16:06:53 +0000 (17:06 +0100)
Instead of SSL_CTX_set_custom_cli_ext and SSL_CTX_set_custom_srv_ext
use SSL_CTX_add_client_custom_ext and SSL_CTX_add_server_custom_ext.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
apps/s_client.c
ssl/ssl.h
ssl/ssl_rsa.c
ssl/ssltest.c
ssl/t1_ext.c

index e4007c290575ea9191fa111defb5f7ac6f71d00e..33926539424293f01fb600944942dc5a95b1809e 100644 (file)
@@ -1361,7 +1361,7 @@ bad:
                        {
                        for (i = 0; i < serverinfo_types_count; i++)
                                {
-                               SSL_CTX_set_custom_cli_ext(ctx,
+                               SSL_CTX_add_client_custom_ext(ctx,
                                                           serverinfo_types[i],
                                                           NULL, NULL, NULL,
                                                           serverinfo_cli_cb,
index f363e8f3bcedb74b92ac38421e11057acdcd55bf..750dbabd4fec0bc83cdb41316922537306e16ebd 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -1253,13 +1253,13 @@ const char *SSL_get_psk_identity(const SSL *s);
 #ifndef OPENSSL_NO_TLSEXT
 /* Register callbacks to handle custom TLS Extensions for client or server. */
 
-int SSL_CTX_set_custom_cli_ext(SSL_CTX *ctx, unsigned int ext_type,
+int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                               custom_ext_add_cb add_cb,
                               custom_ext_free_cb free_cb,
                                void *add_arg,
                               custom_ext_parse_cb parse_cb, void *parse_arg);
 
-int SSL_CTX_set_custom_srv_ext(SSL_CTX *ctx, unsigned int ext_type,
+int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                               custom_ext_add_cb add_cb,
                               custom_ext_free_cb free_cb,
                                void *add_arg,
index 6e3d44c79cb9591abd4dc502757642ed5440ddff..510e564d862f25e5d55b60a8942f21265cea85c3 100644 (file)
@@ -920,7 +920,7 @@ static int serverinfo_process_buffer(const unsigned char *serverinfo,
 
                /* Register callbacks for extensions */
                ext_type = (serverinfo[0] << 8) + serverinfo[1];
-               if (ctx && !SSL_CTX_set_custom_srv_ext(ctx, ext_type, 
+               if (ctx && !SSL_CTX_add_server_custom_ext(ctx, ext_type, 
                                                       serverinfo_srv_add_cb,
                                                       NULL, NULL,
                                                       serverinfo_srv_parse_cb, 
index 09400a18552abbadde7363a2e36d58bbb0e02979..9680b66d00b034078cef28b485ec47e0da61db85 100644 (file)
@@ -1584,11 +1584,11 @@ bad:
 #endif
 
        if (serverinfo_sct)
-               SSL_CTX_set_custom_cli_ext(c_ctx, SCT_EXT_TYPE,
+               SSL_CTX_add_client_custom_ext(c_ctx, SCT_EXT_TYPE,
                                           NULL, NULL, NULL,
                                           serverinfo_cli_cb, NULL);
        if (serverinfo_tack)
-               SSL_CTX_set_custom_cli_ext(c_ctx, TACK_EXT_TYPE,
+               SSL_CTX_add_client_custom_ext(c_ctx, TACK_EXT_TYPE,
                                           NULL, NULL, NULL,
                                           serverinfo_cli_cb, NULL);
 
@@ -1601,30 +1601,30 @@ bad:
 
        if (custom_ext)
                {
-               SSL_CTX_set_custom_cli_ext(c_ctx, CUSTOM_EXT_TYPE_0, 
+               SSL_CTX_add_client_custom_ext(c_ctx, CUSTOM_EXT_TYPE_0, 
                                           custom_ext_0_cli_add_cb, NULL, NULL,
                                           custom_ext_0_cli_parse_cb, NULL);
-               SSL_CTX_set_custom_cli_ext(c_ctx, CUSTOM_EXT_TYPE_1, 
+               SSL_CTX_add_client_custom_ext(c_ctx, CUSTOM_EXT_TYPE_1, 
                                           custom_ext_1_cli_add_cb, NULL, NULL,
                                           custom_ext_1_cli_parse_cb, NULL);
-               SSL_CTX_set_custom_cli_ext(c_ctx, CUSTOM_EXT_TYPE_2, 
+               SSL_CTX_add_client_custom_ext(c_ctx, CUSTOM_EXT_TYPE_2, 
                                           custom_ext_2_cli_add_cb, NULL, NULL,
                                           custom_ext_2_cli_parse_cb, NULL);
-               SSL_CTX_set_custom_cli_ext(c_ctx, CUSTOM_EXT_TYPE_3, 
+               SSL_CTX_add_client_custom_ext(c_ctx, CUSTOM_EXT_TYPE_3, 
                                           custom_ext_3_cli_add_cb, NULL, NULL,
                                           custom_ext_3_cli_parse_cb, NULL);
 
 
-               SSL_CTX_set_custom_srv_ext(s_ctx, CUSTOM_EXT_TYPE_0, 
+               SSL_CTX_add_server_custom_ext(s_ctx, CUSTOM_EXT_TYPE_0, 
                                           custom_ext_0_srv_add_cb, NULL, NULL,
                                           custom_ext_0_srv_parse_cb, NULL);
-               SSL_CTX_set_custom_srv_ext(s_ctx, CUSTOM_EXT_TYPE_1, 
+               SSL_CTX_add_server_custom_ext(s_ctx, CUSTOM_EXT_TYPE_1, 
                                           custom_ext_1_srv_add_cb, NULL, NULL,
                                           custom_ext_1_srv_parse_cb, NULL);
-               SSL_CTX_set_custom_srv_ext(s_ctx, CUSTOM_EXT_TYPE_2, 
+               SSL_CTX_add_server_custom_ext(s_ctx, CUSTOM_EXT_TYPE_2, 
                                           custom_ext_2_srv_add_cb, NULL, NULL,
                                           custom_ext_2_srv_parse_cb, NULL);
-               SSL_CTX_set_custom_srv_ext(s_ctx, CUSTOM_EXT_TYPE_3, 
+               SSL_CTX_add_server_custom_ext(s_ctx, CUSTOM_EXT_TYPE_3, 
                                           custom_ext_3_srv_add_cb, NULL, NULL,
                                           custom_ext_3_srv_parse_cb, NULL);
                }
index 0cca8d55069688f397a8e13f0720bfe76f6e1d1a..615070826a0e351d68f084fb7fa0a32e97c5d8a2 100644 (file)
@@ -210,7 +210,7 @@ void custom_exts_free(custom_ext_methods *exts)
        }
 
 /* Set callbacks for a custom extension */
-static int custom_ext_set(custom_ext_methods *exts,
+static int custom_ext_meth_add(custom_ext_methods *exts,
                        unsigned int ext_type,
                        custom_ext_add_cb add_cb,
                        custom_ext_free_cb free_cb,
@@ -250,25 +250,25 @@ static int custom_ext_set(custom_ext_methods *exts,
 
 /* Application level functions to add custom extension callbacks */
 
-int SSL_CTX_set_custom_cli_ext(SSL_CTX *ctx, unsigned int ext_type,
+int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                               custom_ext_add_cb add_cb,
                               custom_ext_free_cb free_cb,
                                void *add_arg,
                               custom_ext_parse_cb parse_cb, void *parse_arg)
 
        {
-       return custom_ext_set(&ctx->cert->cli_ext, ext_type,
+       return custom_ext_meth_add(&ctx->cert->cli_ext, ext_type,
                                add_cb, free_cb, add_arg,
                                parse_cb, parse_arg);
        }
 
-int SSL_CTX_set_custom_srv_ext(SSL_CTX *ctx, unsigned int ext_type,
+int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                               custom_ext_add_cb add_cb,
                               custom_ext_free_cb free_cb,
                                void *add_arg,
                               custom_ext_parse_cb parse_cb, void *parse_arg)
        {
-       return custom_ext_set(&ctx->cert->srv_ext, ext_type,
+       return custom_ext_meth_add(&ctx->cert->srv_ext, ext_type,
                                add_cb, free_cb, add_arg,
                                parse_cb, parse_arg);
        }