From: Markus Triska Date: Mon, 18 May 2020 09:12:59 +0000 (+0200) Subject: type check for length argument in crypto_data_hkdf/4 X-Git-Tag: v0.8.123~17^2~5 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=70ad44adfd7110d7627949e4be29230aff784737;p=scryer-prolog.git type check for length argument in crypto_data_hkdf/4 Reported by @notoria in #527. --- 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, []),