-/* $OpenBSD: ssl.h,v 1.138 2018/02/17 15:13:12 jsing Exp $ */
+/* $OpenBSD: ssl.h,v 1.139 2018/02/17 15:19:43 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
void SSL_set_tmp_ecdh_callback(SSL *ssl,
EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength));
+size_t SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out);
+size_t SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out);
+
const void *SSL_get_current_compression(SSL *s);
const void *SSL_get_current_expansion(SSL *s);
-/* $OpenBSD: ssl_lib.c,v 1.175 2018/02/17 15:13:12 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.176 2018/02/17 15:19:43 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return (X509_VERIFY_PARAM_get_depth(ctx->param));
}
-int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *)
+int
+(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *)
{
return (ctx->internal->default_verify_callback);
}
return (NULL);
}
+size_t
+SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out)
+{
+ size_t len = sizeof(s->s3->client_random);
+
+ if (out == NULL)
+ return len;
+
+ if (len > max_out)
+ len = max_out;
+
+ memcpy(out, s->s3->client_random, len);
+
+ return len;
+}
+
+size_t
+SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out)
+{
+ size_t len = sizeof(s->s3->server_random);
+
+ if (out == NULL)
+ return len;
+
+ if (len > max_out)
+ len = max_out;
+
+ memcpy(out, s->s3->server_random, len);
+
+ return len;
+}
+
int
ssl_init_wbio_buffer(SSL *s, int push)
{