From 5a13be89188bc629cf7caa718dc111787f564680 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 24 Feb 2020 04:32:37 -0800 Subject: [PATCH] pss: extra validity check --- libvapours/include/vapours/crypto/impl/crypto_rsa_pss_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libvapours/include/vapours/crypto/impl/crypto_rsa_pss_impl.hpp b/libvapours/include/vapours/crypto/impl/crypto_rsa_pss_impl.hpp index 8c783b00..fc0af104 100644 --- a/libvapours/include/vapours/crypto/impl/crypto_rsa_pss_impl.hpp +++ b/libvapours/include/vapours/crypto/impl/crypto_rsa_pss_impl.hpp @@ -106,6 +106,7 @@ namespace ams::crypto::impl { const u8 *salt = db + salt_ofs; const size_t salt_size = db_len - salt_ofs; is_valid &= (salt_size != 0); + is_valid &= (salt_size != db_len); /* Verify hash. */ u8 cmp_hash[HashSize];