Git sshd 的差异解释
Git diff explanation for sshd
我有一个差异:
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 上下文的一部分。在“”中查看更多信息。
这将手动将该补丁应用到您的 src/arc4random.c
.
版本
我有一个差异:
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 上下文的一部分。在“src/arc4random.c
.