summaryrefslogtreecommitdiff
path: root/lib/crypto/c_src/dh.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/c_src/dh.c')
-rw-r--r--lib/crypto/c_src/dh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/crypto/c_src/dh.c b/lib/crypto/c_src/dh.c
index 4bcab0ec6e..15a08470a6 100644
--- a/lib/crypto/c_src/dh.c
+++ b/lib/crypto/c_src/dh.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2022. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2023. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ ERL_NIF_TERM dh_compute_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg
/* Has 3_0 */
ERL_NIF_TERM dh_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (PrivKey|undefined, DHParams=[P,G], 0, Len|0) */
- unsigned long len = 0;
+ ErlNifUInt64 len = 0;
int i = 0;
OSSL_PARAM params[8];
EVP_PKEY *pkey = NULL, *pkey_gen = NULL;
@@ -84,7 +84,7 @@ ERL_NIF_TERM dh_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
*/
/* argv[3] is the length of the private key that is to be generated */
- if (!enif_get_ulong(env, argv[3], &len) ||
+ if (!enif_get_uint64(env, argv[3], &len) ||
(len > LONG_MAX) ) {
ret = EXCP_BADARG_N(env, 3, "Bad value of length element");
goto done;