我有一个差异:
diff --git openbsd-compat/arc4random.c openbsd-compat/arc4random.c
--- openbsd-compat/arc4random.c
+++ openbsd-compat/arc4random.c
@@ -242,7 +242,7 @@ void
arc4random_buf(void *buf, size_t n)
{
_ARC4_LOCK();
- _rs_random_buf(buf, n);
+ memset(buf, 0, n);
_ARC4_UNLOCK();
}
# endif /* !HAVE_ARC4RANDOM_BUF */
但我不明白,我究竟需要如何修改:
https://github.com/openbsd/src/blob/master/lib/libc/crypt/arc4random.c
代码与差异完全相同。
有人可以解释一下吗?还是我看错了 arc4random.c 文件?只是想减少基于测试目的的随机性:http://www.vegardno.net/2017/03/fuzzing-openssh-daemon-using-afl.html
最佳答案
您需要 change the line 195 , 这是删除行
- _rs_random_buf(buf, n);
并添加一行:
+ memset(buf, 0, n);
(代替)
更改行上方和下方的行是diff hunk 上下文的一部分。在“Unexpected result in git-diff”中查看更多信息。
这将手动将该补丁应用于您的 src/arc4random.c
版本。
关于sshd 的 Git diff 解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49721901/