Add SSL_get_tlsext_status_type() method
authorAlessandro Ghedini <alessandro@ghedini.me>
Tue, 10 May 2016 23:48:49 +0000 (00:48 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 7 Jun 2016 16:05:52 +0000 (17:05 +0100)
The tlsext_status_type field in SSL is used by e.g. OpenResty to determine
if the client requested the certificate status, but SSL is now opaque.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
include/openssl/ssl.h
include/openssl/tls1.h
ssl/s3_lib.c

index 9989b7eed2cce163734721e2e518b6c0ce54156d..2c897c40c8a5309a772b15676c943c6fda491120 100644 (file)
@@ -1133,6 +1133,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
 # define SSL_CTRL_SET_MAX_PROTO_VERSION          124
 # define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT        125
 # define SSL_CTRL_SET_MAX_PIPELINES              126
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE     127
 # define SSL_CERT_SET_FIRST                      1
 # define SSL_CERT_SET_NEXT                       2
 # define SSL_CERT_SET_SERVER                     3
index 0537828afabd66d2c6f179436c113191dfd471e6..25a9b36f9a4b0310df7272f4166b96abd1e7883c 100644 (file)
@@ -252,6 +252,9 @@ SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)
 # define SSL_set_tlsext_debug_arg(ssl, arg) \
 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)
 
+# define SSL_get_tlsext_status_type(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0, (void *)arg)
+
 # define SSL_set_tlsext_status_type(ssl, type) \
 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)
 
index de7f1c08f2985a59b75fabeb6cdca4fd6b26116d..025c003b3e6ee177c951595134249de2f4ebcd64 100644 (file)
@@ -2971,6 +2971,11 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
         ret = 1;
         break;
 
+    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
+        *(int *)parg = s->tlsext_status_type;
+        ret = 1;
+        break;
+
     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
         s->tlsext_status_type = larg;
         ret = 1;