STACK_OF(OCSP_RESPONSE) *sk_resp = NULL;
OCSP_RESPONSE *rsp;
- if (SSL_version(s) >= TLS1_3_VERSION) {
+ if ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION)
+ || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION)) {
(void)SSL_get0_tlsext_status_ocsp_resp_ex(s, &sk_resp);
BIO_puts(arg, "OCSP responses: ");
sk_OCSP_RESPONSE_pop_free(*sk_resp, OCSP_RESPONSE_free);
SSL_get0_chain_certs(s, &server_certs);
- /*
- * TODO(DTLS-1.3): in future DTLS should also be considered
- */
+
if (server_certs != NULL && srctx->status_all &&
- !SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION) {
+ ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION)
+ || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION))) {
/* certificate chain is available */
num = sk_X509_num(server_certs) + 1;
}
}
SSL_get0_chain_certs(s, &server_certs);
- /*
- * TODO(DTLS-1.3): in future DTLS should also be considered
- */
+
if (server_certs != NULL && srctx->status_all &&
- !SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION) {
+ ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION)
+ || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION))) {
/* certificate chain is available */
num = sk_X509_num(server_certs) + 1;
} else {
SSL_CTX *sctx;
#ifndef OPENSSL_NO_OCSP
SSL *ssl;
+ const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
#endif
/* Something must be passed in */
*/
#ifndef OPENSSL_NO_OCSP
ssl = SSL_CONNECTION_GET_SSL(s);
- /*
- * TODO(DTLS-1.3): in future DTLS should also be considered
- */
- if (!SSL_is_dtls(ssl) && SSL_version(ssl) >= TLS1_3_VERSION) {
+
+ if (ssl_version_cmp(s, SSL_version(ssl), version1_3) >= 0) {
/* ignore status_request_v2 if TLS version < 1.3 */
int status = SSL_get_tlsext_status_type(ssl);
if (s->ext.ocsp.resp_ex == NULL)
s->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_null();
- /*
- * TODO(DTLS-1.3): in future DTLS should also be considered
- */
- if (!SSL_CONNECTION_IS_TLS13(s) && type == TLSEXT_STATUSTYPE_ocsp) {
+ if (!SSL_CONNECTION_IS_VERSION13(s) && type == TLSEXT_STATUSTYPE_ocsp) {
sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
s->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_null();
}