diff options
author | Colin Watson <cjwatson@debian.org> | 2008-05-20 19:59:07 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2008-05-20 19:59:07 +0000 |
commit | 2231f4c3038aefc1f77cf456b188b53fb6da4a13 (patch) | |
tree | a7bac02b6fa3cd8c2f22f9fd76c45b7f47d4ac60 /debian/tests/keygen-test | |
parent | 15177d9485f496337dabadb0364c08be971c1239 (diff) |
Generate two keys with the PID forced to the same value and test that
they differ, to defend against recurrences of the recent Debian OpenSSL
vulnerability.
Diffstat (limited to 'debian/tests/keygen-test')
-rwxr-xr-x | debian/tests/keygen-test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/debian/tests/keygen-test b/debian/tests/keygen-test new file mode 100755 index 000000000..02b7c761a --- /dev/null +++ b/debian/tests/keygen-test | |||
@@ -0,0 +1,12 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | rm -f key1 key1.pub key2 key2.pub | ||
4 | LD_PRELOAD="$(pwd)/getpid.so" FORCE_PID=1234 \ | ||
5 | ../../build-deb/ssh-keygen -N '' -f key1 >/dev/null | ||
6 | LD_PRELOAD="$(pwd)/getpid.so" FORCE_PID=1234 \ | ||
7 | ../../build-deb/ssh-keygen -N '' -f key2 >/dev/null | ||
8 | if cmp -s key1 key2; then | ||
9 | echo "Generated two identical keys!" >&2 | ||
10 | exit 1 | ||
11 | fi | ||
12 | exit 0 | ||