diff options
author | jsing <> | 2018-02-17 15:08:21 +0000 |
---|---|---|
committer | jsing <> | 2018-02-17 15:08:21 +0000 |
commit | ca5a90bc040c87944d3af58d51c80de05b02c60b (patch) | |
tree | aacdd412fb71ab5d0466f64cd0603eaa1c31d0f2 | |
parent | 3b7cdf9c768759bfba3e3afd3a234cc44ef4c7c1 (diff) | |
download | openbsd-ca5a90bc040c87944d3af58d51c80de05b02c60b.tar.gz openbsd-ca5a90bc040c87944d3af58d51c80de05b02c60b.tar.bz2 openbsd-ca5a90bc040c87944d3af58d51c80de05b02c60b.zip |
Provide SSL_CTX_get_tlsext_status_cb() and SSL_CTX_get_tlsext_status_arg().
-rw-r--r-- | src/lib/libssl/s3_lib.c | 16 | ||||
-rw-r--r-- | src/lib/libssl/ssl.h | 4 | ||||
-rw-r--r-- | src/lib/libssl/tls1.h | 8 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index a15003b053..8f75cf9498 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_lib.c,v 1.163 2018/01/27 15:09:15 jsing Exp $ */ | 1 | /* $OpenBSD: s3_lib.c,v 1.164 2018/02/17 15:08:21 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -2134,6 +2134,13 @@ _SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, unsigned char *keys, int keys_len) | |||
2134 | } | 2134 | } |
2135 | 2135 | ||
2136 | static int | 2136 | static int |
2137 | _SSL_CTX_get_tlsext_status_arg(SSL_CTX *ctx, void **arg) | ||
2138 | { | ||
2139 | *arg = ctx->internal->tlsext_status_arg; | ||
2140 | return 1; | ||
2141 | } | ||
2142 | |||
2143 | static int | ||
2137 | _SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) | 2144 | _SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) |
2138 | { | 2145 | { |
2139 | ctx->internal->tlsext_status_arg = arg; | 2146 | ctx->internal->tlsext_status_arg = arg; |
@@ -2215,6 +2222,9 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) | |||
2215 | case SSL_CTRL_SET_TLSEXT_TICKET_KEYS: | 2222 | case SSL_CTRL_SET_TLSEXT_TICKET_KEYS: |
2216 | return _SSL_CTX_set_tlsext_ticket_keys(ctx, parg, larg); | 2223 | return _SSL_CTX_set_tlsext_ticket_keys(ctx, parg, larg); |
2217 | 2224 | ||
2225 | case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG: | ||
2226 | return _SSL_CTX_get_tlsext_status_arg(ctx, parg); | ||
2227 | |||
2218 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG: | 2228 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG: |
2219 | return _SSL_CTX_set_tlsext_status_arg(ctx, parg); | 2229 | return _SSL_CTX_set_tlsext_status_arg(ctx, parg); |
2220 | 2230 | ||
@@ -2279,6 +2289,10 @@ ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) | |||
2279 | (int (*)(SSL *, int *, void *))fp; | 2289 | (int (*)(SSL *, int *, void *))fp; |
2280 | return 1; | 2290 | return 1; |
2281 | 2291 | ||
2292 | case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB: | ||
2293 | *(int (**)(SSL *, void *))fp = ctx->internal->tlsext_status_cb; | ||
2294 | return 1; | ||
2295 | |||
2282 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB: | 2296 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB: |
2283 | ctx->internal->tlsext_status_cb = (int (*)(SSL *, void *))fp; | 2297 | ctx->internal->tlsext_status_cb = (int (*)(SSL *, void *))fp; |
2284 | return 1; | 2298 | return 1; |
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 51b8fdb3cc..bc0f5316a4 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl.h,v 1.136 2018/02/14 17:08:44 jsing Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.137 2018/02/17 15:08:21 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1080,7 +1080,9 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); | |||
1080 | #define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 | 1080 | #define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 |
1081 | #define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 | 1081 | #define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 |
1082 | #define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 | 1082 | #define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 |
1083 | #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 | ||
1083 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 | 1084 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 |
1085 | #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 | ||
1084 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 | 1086 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 |
1085 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 | 1087 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 |
1086 | #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 | 1088 | #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 |
diff --git a/src/lib/libssl/tls1.h b/src/lib/libssl/tls1.h index 8e369c7bd1..0474bb73ae 100644 --- a/src/lib/libssl/tls1.h +++ b/src/lib/libssl/tls1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls1.h,v 1.31 2017/08/28 17:36:58 jsing Exp $ */ | 1 | /* $OpenBSD: tls1.h,v 1.32 2018/02/17 15:08:21 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -354,11 +354,15 @@ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) | |||
354 | #define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ | 354 | #define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ |
355 | SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys)) | 355 | SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys)) |
356 | 356 | ||
357 | #define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ | ||
358 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) | ||
357 | #define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ | 359 | #define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ |
358 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) | 360 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) |
359 | 361 | ||
362 | #define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ | ||
363 | SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) | ||
360 | #define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ | 364 | #define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ |
361 | SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) | 365 | SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) |
362 | 366 | ||
363 | #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ | 367 | #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ |
364 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | 368 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) |