Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Platform-specific and custom entropy polling functions |
| 3 | * |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 4 | * Copyright The Mbed TLS Contributors |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | * not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
Gilles Peskine | a1f9ef0 | 2020-09-30 22:18:13 +0200 | [diff] [blame] | 20 | #if defined(__linux__) && !defined(_GNU_SOURCE) |
Nicholas Wilson | 2682edf | 2017-12-05 12:08:15 +0000 | [diff] [blame] | 21 | /* Ensure that syscall() is available even when compiling with -std=c99 */ |
| 22 | #define _GNU_SOURCE |
| 23 | #endif |
| 24 | |
Gilles Peskine | db09ef6 | 2020-06-03 01:43:33 +0200 | [diff] [blame] | 25 | #include "common.h" |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 26 | |
Gilles Peskine | 02b9329 | 2018-06-01 14:38:45 +0200 | [diff] [blame] | 27 | #include <string.h> |
| 28 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 29 | #if defined(MBEDTLS_ENTROPY_C) |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 30 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 31 | #include "mbedtls/entropy.h" |
| 32 | #include "mbedtls/entropy_poll.h" |
Janos Follath | 24eed8d | 2019-11-22 13:21:35 +0000 | [diff] [blame] | 33 | #include "mbedtls/error.h" |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 34 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 35 | #if defined(MBEDTLS_TIMING_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 36 | #include "mbedtls/timing.h" |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 37 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 38 | #if defined(MBEDTLS_HAVEGE_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 39 | #include "mbedtls/havege.h" |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 40 | #endif |
Paul Bakker | 9988d6b | 2016-06-01 11:29:42 +0100 | [diff] [blame] | 41 | #if defined(MBEDTLS_ENTROPY_NV_SEED) |
| 42 | #include "mbedtls/platform.h" |
| 43 | #endif |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 44 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 45 | #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) |
Manuel Pégourié-Gonnard | 325ce09 | 2016-02-22 10:33:34 +0100 | [diff] [blame] | 46 | |
| 47 | #if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ |
Augustin Cavalier | 60bc47d | 2018-04-11 20:27:32 -0400 | [diff] [blame] | 48 | !defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \ |
Ørjan Malde | 479d8de | 2020-05-20 09:32:39 +0000 | [diff] [blame] | 49 | !defined(__HAIKU__) && !defined(__midipix__) |
Manuel Pégourié-Gonnard | 325ce09 | 2016-02-22 10:33:34 +0100 | [diff] [blame] | 50 | #error "Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in config.h" |
| 51 | #endif |
| 52 | |
Paul Bakker | fa6a620 | 2013-10-28 18:48:30 +0100 | [diff] [blame] | 53 | #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 54 | |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 55 | #if !defined(_WIN32_WINNT) |
| 56 | #define _WIN32_WINNT 0x0400 |
| 57 | #endif |
Paul Bakker | 4a2bd0d | 2012-11-02 11:06:08 +0000 | [diff] [blame] | 58 | #include <windows.h> |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 59 | #include <wincrypt.h> |
| 60 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 61 | int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len, |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 62 | size_t *olen ) |
| 63 | { |
| 64 | HCRYPTPROV provider; |
Paul Bakker | 6bcfc67 | 2011-12-05 13:54:00 +0000 | [diff] [blame] | 65 | ((void) data); |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 66 | *olen = 0; |
| 67 | |
| 68 | if( CryptAcquireContext( &provider, NULL, NULL, |
| 69 | PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == FALSE ) |
| 70 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 71 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Paul Bakker | b9cfaa0 | 2013-10-11 18:58:55 +0200 | [diff] [blame] | 74 | if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) |
Attila Molnar | 2791ba1 | 2016-01-26 11:39:26 +0100 | [diff] [blame] | 75 | { |
| 76 | CryptReleaseContext( provider, 0 ); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
Attila Molnar | 2791ba1 | 2016-01-26 11:39:26 +0100 | [diff] [blame] | 78 | } |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 79 | |
| 80 | CryptReleaseContext( provider, 0 ); |
| 81 | *olen = len; |
| 82 | |
| 83 | return( 0 ); |
| 84 | } |
Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 85 | #else /* _WIN32 && !EFIX64 && !EFI32 */ |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 86 | |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 87 | /* |
| 88 | * Test for Linux getrandom() support. |
Gilles Peskine | c6468ee | 2020-09-30 22:11:13 +0200 | [diff] [blame] | 89 | * Since there is no wrapper in the libc yet, use the generic syscall wrapper |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 90 | * available in GNU libc and compatible libc's (eg uClibc). |
| 91 | */ |
Gilles Peskine | c6468ee | 2020-09-30 22:11:13 +0200 | [diff] [blame] | 92 | #if ((defined(__linux__) && defined(__GLIBC__)) || defined(__midipix__)) |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 93 | #include <unistd.h> |
| 94 | #include <sys/syscall.h> |
| 95 | #if defined(SYS_getrandom) |
| 96 | #define HAVE_GETRANDOM |
Hanno Becker | 2751697 | 2018-10-18 11:49:25 +0100 | [diff] [blame] | 97 | #include <errno.h> |
Manuel Pégourié-Gonnard | bcf13ba | 2015-06-22 18:06:17 +0200 | [diff] [blame] | 98 | |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 99 | static int getrandom_wrapper( void *buf, size_t buflen, unsigned int flags ) |
| 100 | { |
Manuel Pégourié-Gonnard | bcf13ba | 2015-06-22 18:06:17 +0200 | [diff] [blame] | 101 | /* MemSan cannot understand that the syscall writes to the buffer */ |
| 102 | #if defined(__has_feature) |
| 103 | #if __has_feature(memory_sanitizer) |
| 104 | memset( buf, 0, buflen ); |
| 105 | #endif |
| 106 | #endif |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 107 | return( syscall( SYS_getrandom, buf, buflen, flags ) ); |
| 108 | } |
Manuel Pégourié-Gonnard | d97828e | 2015-04-29 14:03:28 +0200 | [diff] [blame] | 109 | #endif /* SYS_getrandom */ |
Ørjan Malde | 479d8de | 2020-05-20 09:32:39 +0000 | [diff] [blame] | 110 | #endif /* __linux__ || __midipix__ */ |
Manuel Pégourié-Gonnard | 1829245 | 2015-01-09 14:34:13 +0100 | [diff] [blame] | 111 | |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 112 | /* |
| 113 | * Some BSD systems provide KERN_ARND. |
| 114 | * This is equivalent to reading from /dev/urandom, only it doesn't require an |
| 115 | * open file descriptor, and provides up to 256 bytes per call (basically the |
| 116 | * same as getentropy(), but with a longer history). |
| 117 | * |
| 118 | * Documentation: https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7 |
| 119 | */ |
| 120 | #if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(HAVE_GETRANDOM) |
| 121 | #include <sys/param.h> |
| 122 | #include <sys/sysctl.h> |
| 123 | #if defined(KERN_ARND) |
| 124 | #define HAVE_SYSCTL_ARND |
| 125 | |
nia | 8373c86 | 2020-06-24 17:15:02 +0100 | [diff] [blame] | 126 | static int sysctl_arnd_wrapper( unsigned char *buf, size_t buflen ) |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 127 | { |
| 128 | int name[2]; |
| 129 | size_t len; |
| 130 | |
| 131 | name[0] = CTL_KERN; |
| 132 | name[1] = KERN_ARND; |
| 133 | |
| 134 | while( buflen > 0 ) |
| 135 | { |
| 136 | len = buflen > 256 ? 256 : buflen; |
nia | 8373c86 | 2020-06-24 17:15:02 +0100 | [diff] [blame] | 137 | if( sysctl(name, 2, buf, &len, NULL, 0) == -1 ) |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 138 | return( -1 ); |
| 139 | buflen -= len; |
nia | 8373c86 | 2020-06-24 17:15:02 +0100 | [diff] [blame] | 140 | buf += len; |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 141 | } |
| 142 | return( 0 ); |
| 143 | } |
| 144 | #endif /* KERN_ARND */ |
| 145 | #endif /* __FreeBSD__ || __NetBSD__ */ |
| 146 | |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 147 | #include <stdio.h> |
| 148 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 149 | int mbedtls_platform_entropy_poll( void *data, |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 150 | unsigned char *output, size_t len, size_t *olen ) |
| 151 | { |
| 152 | FILE *file; |
Manuel Pégourié-Gonnard | ea35666 | 2015-08-27 12:02:40 +0200 | [diff] [blame] | 153 | size_t read_len; |
Janos Follath | 24eed8d | 2019-11-22 13:21:35 +0000 | [diff] [blame] | 154 | int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 155 | ((void) data); |
| 156 | |
Manuel Pégourié-Gonnard | d97828e | 2015-04-29 14:03:28 +0200 | [diff] [blame] | 157 | #if defined(HAVE_GETRANDOM) |
Hanno Becker | 2751697 | 2018-10-18 11:49:25 +0100 | [diff] [blame] | 158 | ret = getrandom_wrapper( output, len, 0 ); |
| 159 | if( ret >= 0 ) |
Manuel Pégourié-Gonnard | d97828e | 2015-04-29 14:03:28 +0200 | [diff] [blame] | 160 | { |
Manuel Pégourié-Gonnard | d97828e | 2015-04-29 14:03:28 +0200 | [diff] [blame] | 161 | *olen = ret; |
| 162 | return( 0 ); |
| 163 | } |
Hanno Becker | 2751697 | 2018-10-18 11:49:25 +0100 | [diff] [blame] | 164 | else if( errno != ENOSYS ) |
| 165 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
| 166 | /* Fall through if the system call isn't known. */ |
| 167 | #else |
Hanno Becker | 9772da8 | 2018-11-05 11:43:07 +0000 | [diff] [blame] | 168 | ((void) ret); |
Manuel Pégourié-Gonnard | d97828e | 2015-04-29 14:03:28 +0200 | [diff] [blame] | 169 | #endif /* HAVE_GETRANDOM */ |
| 170 | |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 171 | #if defined(HAVE_SYSCTL_ARND) |
| 172 | ((void) file); |
| 173 | ((void) read_len); |
nia | f4d9f21 | 2020-06-19 16:14:27 +0100 | [diff] [blame] | 174 | if( sysctl_arnd_wrapper( output, len ) == -1 ) |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 175 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
| 176 | *olen = len; |
| 177 | return( 0 ); |
| 178 | #else |
| 179 | |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 180 | *olen = 0; |
| 181 | |
| 182 | file = fopen( "/dev/urandom", "rb" ); |
| 183 | if( file == NULL ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 184 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 185 | |
Manuel Pégourié-Gonnard | ea35666 | 2015-08-27 12:02:40 +0200 | [diff] [blame] | 186 | read_len = fread( output, 1, len, file ); |
| 187 | if( read_len != len ) |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 188 | { |
| 189 | fclose( file ); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 190 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | fclose( file ); |
| 194 | *olen = len; |
| 195 | |
| 196 | return( 0 ); |
nia | 9f5312c | 2020-06-11 13:32:13 +0100 | [diff] [blame] | 197 | #endif /* HAVE_SYSCTL_ARND */ |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 198 | } |
Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 199 | #endif /* _WIN32 && !EFIX64 && !EFI32 */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 200 | #endif /* !MBEDTLS_NO_PLATFORM_ENTROPY */ |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 201 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 202 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) |
Simon Butcher | 4157b60 | 2016-06-12 00:31:33 +0100 | [diff] [blame] | 203 | int mbedtls_null_entropy_poll( void *data, |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 204 | unsigned char *output, size_t len, size_t *olen ) |
| 205 | { |
| 206 | ((void) data); |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 207 | ((void) output); |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 208 | *olen = 0; |
| 209 | |
| 210 | if( len < sizeof(unsigned char) ) |
| 211 | return( 0 ); |
| 212 | |
| 213 | *olen = sizeof(unsigned char); |
| 214 | |
| 215 | return( 0 ); |
| 216 | } |
| 217 | #endif |
| 218 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 219 | #if defined(MBEDTLS_TIMING_C) |
| 220 | int mbedtls_hardclock_poll( void *data, |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 221 | unsigned char *output, size_t len, size_t *olen ) |
| 222 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 223 | unsigned long timer = mbedtls_timing_hardclock(); |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 224 | ((void) data); |
| 225 | *olen = 0; |
| 226 | |
| 227 | if( len < sizeof(unsigned long) ) |
| 228 | return( 0 ); |
| 229 | |
| 230 | memcpy( output, &timer, sizeof(unsigned long) ); |
| 231 | *olen = sizeof(unsigned long); |
| 232 | |
| 233 | return( 0 ); |
| 234 | } |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 235 | #endif /* MBEDTLS_TIMING_C */ |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 236 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 237 | #if defined(MBEDTLS_HAVEGE_C) |
| 238 | int mbedtls_havege_poll( void *data, |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 239 | unsigned char *output, size_t len, size_t *olen ) |
| 240 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 241 | mbedtls_havege_state *hs = (mbedtls_havege_state *) data; |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 242 | *olen = 0; |
| 243 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 244 | if( mbedtls_havege_random( hs, output, len ) != 0 ) |
| 245 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 246 | |
| 247 | *olen = len; |
| 248 | |
| 249 | return( 0 ); |
| 250 | } |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 251 | #endif /* MBEDTLS_HAVEGE_C */ |
Paul Bakker | 6083fd2 | 2011-12-03 21:45:14 +0000 | [diff] [blame] | 252 | |
Paul Bakker | 9988d6b | 2016-06-01 11:29:42 +0100 | [diff] [blame] | 253 | #if defined(MBEDTLS_ENTROPY_NV_SEED) |
| 254 | int mbedtls_nv_seed_poll( void *data, |
| 255 | unsigned char *output, size_t len, size_t *olen ) |
| 256 | { |
| 257 | unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; |
| 258 | size_t use_len = MBEDTLS_ENTROPY_BLOCK_SIZE; |
| 259 | ((void) data); |
| 260 | |
| 261 | memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); |
| 262 | |
| 263 | if( mbedtls_nv_seed_read( buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) < 0 ) |
| 264 | return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); |
| 265 | |
| 266 | if( len < use_len ) |
| 267 | use_len = len; |
| 268 | |
| 269 | memcpy( output, buf, use_len ); |
| 270 | *olen = use_len; |
| 271 | |
| 272 | return( 0 ); |
| 273 | } |
| 274 | #endif /* MBEDTLS_ENTROPY_NV_SEED */ |
| 275 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 276 | #endif /* MBEDTLS_ENTROPY_C */ |