diff options
| -rw-r--r-- | receiver.cpp | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/receiver.cpp b/receiver.cpp index 01f7505..0e9b305 100644 --- a/receiver.cpp +++ b/receiver.cpp | |||
| @@ -17,6 +17,10 @@ | |||
| 17 | #include "mbedtls/ctr_drbg.h" | 17 | #include "mbedtls/ctr_drbg.h" | 
| 18 | #include "mbedtls/gcm.h" | 18 | #include "mbedtls/gcm.h" | 
| 19 | 19 | ||
| 20 | #if MBEDTLS_VERSION_MAJOR >= 3 | ||
| 21 | #define MBEDTLS_DRBG_BOILERPLATE , mbedtls_ctr_drbg_random, &ctr_drbg | ||
| 22 | #endif | ||
| 23 | |||
| 20 | #include <string> | 24 | #include <string> | 
| 21 | #include <map> | 25 | #include <map> | 
| 22 | #include <set> | 26 | #include <set> | 
| @@ -297,10 +301,10 @@ int main(int argc, char **argv) { | |||
| 297 | mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, pp, sizeof(pp)); | 301 | mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, pp, sizeof(pp)); | 
| 298 | 302 | ||
| 299 | if (privkey_file) { | 303 | if (privkey_file) { | 
| 300 | if ((ret = mbedtls_pk_parse_keyfile(&pk, privkey_file, NULL, mbedtls_ctr_drbg_random, &ctr_drbg) ) != 0 ) | 304 | if ((ret = mbedtls_pk_parse_keyfile(&pk, privkey_file, NULL MBEDTLS_DRBG_BOILERPLATE ) ) != 0 ) | 
| 301 | errx(-1, "Fatal: mbedtls_pk_parse_keyfile returned -0x%04x\n", -ret ); | 305 | errx(-1, "Fatal: mbedtls_pk_parse_keyfile returned -0x%04x\n", -ret ); | 
| 302 | } else { | 306 | } else { | 
| 303 | if ((ret = mbedtls_pk_parse_key(&pk, privkey, sizeof(privkey), NULL, 0, mbedtls_ctr_drbg_random, &ctr_drbg) ) != 0 ) | 307 | if ((ret = mbedtls_pk_parse_key(&pk, privkey, sizeof(privkey), NULL, 0 MBEDTLS_DRBG_BOILERPLATE ) ) != 0 ) | 
| 304 | errx(-1, "Fatal: mbedtls_pk_parse_key returned -0x%04x\n", -ret ); | 308 | errx(-1, "Fatal: mbedtls_pk_parse_key returned -0x%04x\n", -ret ); | 
| 305 | } | 309 | } | 
| 306 | 310 | ||
