From c88f7285289b68aa627ad81ecccbca4fb4b62521 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Sat, 8 Aug 2026 13:42:12 -0700 Subject: [PATCH] Certificate: Fix panic/regression in EMSA_PSS_VERIFY This logic was not properly implemented when switching to `@memmove` from `mem.copyForwards` in ab4028d5796c68ca3aeb649e475bceff394942fc Before this commit, these lines were guaranteed to panic with `source and destination arguments have non-equal lengths` --- lib/std/crypto/Certificate.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/crypto/Certificate.zig b/lib/std/crypto/Certificate.zig index 3bf35280d7a250a3bc029e8797da5da1ac97e92d..974c486b1bf13a5a4a8bf7a7a9be7c37451d0267 100644 --- a/lib/std/crypto/Certificate.zig +++ b/lib/std/crypto/Certificate.zig @@ -1148,8 +1148,8 @@ pub const rsa = struct { } var m_p_buf: [8 + Hash.digest_length + Hash.digest_length]u8 = undefined; var m_p = m_p_buf[0 .. 8 + Hash.digest_length + sLen]; - @memmove(m_p, @as(*const [8]u8, &@splat(0))); - @memmove(m_p[8..], &mHash); + @memmove(m_p[0..8], @as(*const [8]u8, &@splat(0))); + @memmove(m_p[8..][0..Hash.digest_length], &mHash); @memmove(m_p[(8 + Hash.digest_length)..], salt); // 13. Let H' = Hash(M'), an octet string of length hLen. -- 2.54.0