authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-08-08 13:42:12-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-08-08 22:49:10+02:00
logc88f7285289b68aa627ad81ecccbca4fb4b62521
treee151b4c7c4a1418ca16c7b69032fc67c978b303a
parent8380531aecf20405bad6e008712a39795f224cb3

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`

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/crypto/Certificate.zig+2-2
...@@ -1148,8 +1148,8 @@ pub const rsa = struct {...@@ -1148,8 +1148,8 @@ pub const rsa = struct {
1148 }1148 }
1149 var m_p_buf: [8 + Hash.digest_length + Hash.digest_length]u8 = undefined;1149 var m_p_buf: [8 + Hash.digest_length + Hash.digest_length]u8 = undefined;
1150 var m_p = m_p_buf[0 .. 8 + Hash.digest_length + sLen];1150 var m_p = m_p_buf[0 .. 8 + Hash.digest_length + sLen];
1151 @memmove(m_p, @as(*const [8]u8, &@splat(0)));1151 @memmove(m_p[0..8], @as(*const [8]u8, &@splat(0)));
1152 @memmove(m_p[8..], &mHash);1152 @memmove(m_p[8..][0..Hash.digest_length], &mHash);
1153 @memmove(m_p[(8 + Hash.digest_length)..], salt);1153 @memmove(m_p[(8 + Hash.digest_length)..], salt);
11541154
1155 // 13. Let H' = Hash(M'), an octet string of length hLen.1155 // 13. Let H' = Hash(M'), an octet string of length hLen.