From 70ad44adfd7110d7627949e4be29230aff784737 Mon Sep 17 00:00:00 2001 From: Markus Triska Date: Mon, 18 May 2020 11:12:59 +0200 Subject: [PATCH] type check for length argument in crypto_data_hkdf/4 Reported by @notoria in #527. --- src/prolog/lib/crypto.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prolog/lib/crypto.pl b/src/prolog/lib/crypto.pl index 7a246432..419c3d4c 100644 --- a/src/prolog/lib/crypto.pl +++ b/src/prolog/lib/crypto.pl @@ -250,6 +250,8 @@ hash_algorithm(sha512_256). crypto_data_hkdf(Data0, L, Bytes, Options0) :- functor_hash_options(algorithm, Algorithm, Options0, Options), + must_be(integer, L), + L >= 0, option(encoding(Encoding), Options, utf8), encoding_bytes(Encoding, Data0, Data), option(salt(SaltBytes), Options, []), -- 2.54.0