1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

mbedtls: Use getter for ssh_mbedtls_ctr_drbg

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-20 15:56:14 +02:00
parent 1d9f548204
commit 85d2c0371a
5 changed files with 62 additions and 25 deletions

View File

@@ -30,6 +30,9 @@
#ifdef HAVE_LIBMBEDCRYPTO
#include <mbedtls/md.h>
static mbedtls_entropy_context ssh_mbedtls_entropy;
static mbedtls_ctr_drbg_context ssh_mbedtls_ctr_drbg;
struct ssh_mac_ctx_struct {
enum ssh_mac_e mac_type;
mbedtls_md_context_t ctx;
@@ -999,6 +1002,11 @@ int ssh_mbedtls_random(void *where, int len, int strong)
return !rc;
}
mbedtls_ctr_drbg_context *ssh_get_mbedtls_ctr_drbg_context(void)
{
return &ssh_mbedtls_ctr_drbg;
}
void ssh_crypto_finalize(void)
{
if (!libmbedcrypto_initialized) {