Prefix custom extension API callback types with SSL_
authorMatt Caswell <matt@openssl.org>
Fri, 7 Apr 2017 10:04:38 +0000 (11:04 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 7 Apr 2017 12:41:04 +0000 (13:41 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3139)

doc/man3/SSL_extension_supported.pod
include/openssl/ssl.h
ssl/ssl_locl.h
ssl/statem/extensions_cust.c

index 994454be83886885f3c96ce465f8a2885eb7bea3..54a55a73b910ca190801373509e2a10400cf24fc 100644 (file)
@@ -12,29 +12,32 @@ custom_ext_add_cb, custom_ext_free_cb, custom_ext_parse_cb
 
  #include <openssl/ssl.h>
 
- typedef int (*custom_ext_add_cb_ex) (SSL *s, unsigned int ext_type,
-                                      unsigned int context,
-                                      const unsigned char **out,
-                                      size_t *outlen, X509 *x, size_t chainidx,
-                                      int *al, void *add_arg);
-
- typedef void (*custom_ext_free_cb_ex) (SSL *s, unsigned int ext_type,
-                                        unsigned int context,
-                                        const unsigned char *out,
-                                        void *add_arg);
-
- typedef int (*custom_ext_parse_cb_ex) (SSL *s, unsigned int ext_type,
-                                        unsigned int context,
-                                        const unsigned char *in,
-                                        size_t inlen, X509 *x, size_t chainidx,
-                                        int *al, void *parse_arg);
+ typedef int (*SSL_custom_ext_add_cb_ex) (SSL *s, unsigned int ext_type,
+                                          unsigned int context,
+                                          const unsigned char **out,
+                                          size_t *outlen, X509 *x,
+                                          size_t chainidx, int *al,
+                                          void *add_arg);
+
+ typedef void (*SSL_custom_ext_free_cb_ex) (SSL *s, unsigned int ext_type,
+                                            unsigned int context,
+                                            const unsigned char *out,
+                                            void *add_arg);
+
+ typedef int (*SSL_custom_ext_parse_cb_ex) (SSL *s, unsigned int ext_type,
+                                            unsigned int context,
+                                            const unsigned char *in,
+                                            size_t inlen, X509 *x,
+                                            size_t chainidx, int *al,
+                                            void *parse_arg);
 
  int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                             unsigned int context,
-                            custom_ext_add_cb_ex add_cb,
-                            custom_ext_free_cb_ex free_cb,
+                            SSL_custom_ext_add_cb_ex add_cb,
+                            SSL_custom_ext_free_cb_ex free_cb,
                             void *add_arg,
-                            custom_ext_parse_cb_ex parse_cb, void *parse_arg);
+                            SSL_custom_ext_parse_cb_ex parse_cb,
+                            void *parse_arg);
 
  typedef int (*custom_ext_add_cb)(SSL *s, unsigned int ext_type,
                                   const unsigned char **out,
index 8dbfe91f633e684641e8bbf3948af0452d504575..6e3b9c52e5291c19fd36008ac50cdefecb4c1757 100644 (file)
@@ -289,21 +289,24 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
                                     size_t inlen, int *al, void *parse_arg);
 
 
-typedef int (*custom_ext_add_cb_ex) (SSL *s, unsigned int ext_type,
-                                     unsigned int context,
-                                     const unsigned char **out,
-                                     size_t *outlen, X509 *x, size_t chainidx,
-                                     int *al, void *add_arg);
-
-typedef void (*custom_ext_free_cb_ex) (SSL *s, unsigned int ext_type,
-                                       unsigned int context,
-                                       const unsigned char *out, void *add_arg);
-
-typedef int (*custom_ext_parse_cb_ex) (SSL *s, unsigned int ext_type,
-                                       unsigned int context,
-                                       const unsigned char *in,
-                                       size_t inlen, X509 *x, size_t chainidx,
-                                       int *al, void *parse_arg);
+typedef int (*SSL_custom_ext_add_cb_ex) (SSL *s, unsigned int ext_type,
+                                         unsigned int context,
+                                         const unsigned char **out,
+                                         size_t *outlen, X509 *x,
+                                         size_t chainidx,
+                                         int *al, void *add_arg);
+
+typedef void (*SSL_custom_ext_free_cb_ex) (SSL *s, unsigned int ext_type,
+                                           unsigned int context,
+                                           const unsigned char *out,
+                                           void *add_arg);
+
+typedef int (*SSL_custom_ext_parse_cb_ex) (SSL *s, unsigned int ext_type,
+                                           unsigned int context,
+                                           const unsigned char *in,
+                                           size_t inlen, X509 *x,
+                                           size_t chainidx,
+                                           int *al, void *parse_arg);
 
 /* Typedef for verification callback */
 typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx);
@@ -800,10 +803,10 @@ __owur int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
 
 __owur int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                                   unsigned int context,
-                                  custom_ext_add_cb_ex add_cb,
-                                  custom_ext_free_cb_ex free_cb,
+                                  SSL_custom_ext_add_cb_ex add_cb,
+                                  SSL_custom_ext_free_cb_ex free_cb,
                                   void *add_arg,
-                                  custom_ext_parse_cb_ex parse_cb,
+                                  SSL_custom_ext_parse_cb_ex parse_cb,
                                   void *parse_arg);
 
 __owur int SSL_extension_supported(unsigned int ext_type);
index a9ac840e105b0b4d8350baf66c8099ca19dccaca..ad73d8eee6053b4172d211839d82eab22afe8960 100644 (file)
@@ -1630,10 +1630,10 @@ typedef struct {
      * part of an SSL_CTX structure.
      */
     uint32_t ext_flags;
-    custom_ext_add_cb_ex add_cb;
-    custom_ext_free_cb_ex free_cb;
+    SSL_custom_ext_add_cb_ex add_cb;
+    SSL_custom_ext_free_cb_ex free_cb;
     void *add_arg;
-    custom_ext_parse_cb_ex parse_cb;
+    SSL_custom_ext_parse_cb_ex parse_cb;
     void *parse_arg;
 } custom_ext_method;
 
index 6bd50a7297d9bbe9e8f653eedb340fb82d067c62..38bb03b390fcc07cece53b2cb5fcfb77c252afcc 100644 (file)
@@ -303,10 +303,10 @@ int SSL_CTX_has_client_custom_ext(const SSL_CTX *ctx, unsigned int ext_type)
 static int add_custom_ext_intern(SSL_CTX *ctx, int server,
                                  unsigned int ext_type,
                                  unsigned int context,
-                                 custom_ext_add_cb_ex add_cb,
-                                 custom_ext_free_cb_ex free_cb,
+                                 SSL_custom_ext_add_cb_ex add_cb,
+                                 SSL_custom_ext_free_cb_ex free_cb,
                                  void *add_arg,
-                                 custom_ext_parse_cb_ex parse_cb,
+                                 SSL_custom_ext_parse_cb_ex parse_cb,
                                  void *parse_arg)
 {
     custom_ext_methods *exts = &ctx->cert->custext;
@@ -442,10 +442,10 @@ int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
 
 int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
                            unsigned int context,
-                           custom_ext_add_cb_ex add_cb,
-                           custom_ext_free_cb_ex free_cb,
+                           SSL_custom_ext_add_cb_ex add_cb,
+                           SSL_custom_ext_free_cb_ex free_cb,
                            void *add_arg,
-                           custom_ext_parse_cb_ex parse_cb, void *parse_arg)
+                           SSL_custom_ext_parse_cb_ex parse_cb, void *parse_arg)
 {
     return add_custom_ext_intern(ctx, -1, ext_type, context, add_cb, free_cb,
                                  add_arg, parse_cb, parse_arg);