summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/test_sshkey.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
commitf0de78bd4f29fa688c5df116f3f9cd43543a76d0 (patch)
tree856b0dee3f2764c13a32dad5ffe2424fab7fef41 /regress/unittests/sshkey/test_sshkey.c
parent4213eec74e74de6310c27a40c3e9759a08a73996 (diff)
parent8aa3455b16fddea4c0144a7c4a1edb10ec67dcc8 (diff)
Import openssh_8.2p1.orig.tar.gz
Diffstat (limited to 'regress/unittests/sshkey/test_sshkey.c')
-rw-r--r--regress/unittests/sshkey/test_sshkey.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 42395b8db..025bb9815 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_sshkey.c,v 1.18 2019/06/21 04:21:45 djm Exp $ */ 1/* $OpenBSD: test_sshkey.c,v 1.20 2019/11/25 10:32:35 djm Exp $ */
2/* 2/*
3 * Regress test for sshkey.h key management API 3 * Regress test for sshkey.h key management API
4 * 4 *
@@ -101,7 +101,7 @@ build_cert(struct sshbuf *b, struct sshkey *k, const char *type,
101 ASSERT_INT_EQ(sshbuf_put_string(b, NULL, 0), 0); /* reserved */ 101 ASSERT_INT_EQ(sshbuf_put_string(b, NULL, 0), 0); /* reserved */
102 ASSERT_INT_EQ(sshbuf_put_stringb(b, ca_buf), 0); /* signature key */ 102 ASSERT_INT_EQ(sshbuf_put_stringb(b, ca_buf), 0); /* signature key */
103 ASSERT_INT_EQ(sshkey_sign(sign_key, &sigblob, &siglen, 103 ASSERT_INT_EQ(sshkey_sign(sign_key, &sigblob, &siglen,
104 sshbuf_ptr(b), sshbuf_len(b), sig_alg, 0), 0); 104 sshbuf_ptr(b), sshbuf_len(b), sig_alg, NULL, 0), 0);
105 ASSERT_INT_EQ(sshbuf_put_string(b, sigblob, siglen), 0); /* signature */ 105 ASSERT_INT_EQ(sshbuf_put_string(b, sigblob, siglen), 0); /* signature */
106 106
107 free(sigblob); 107 free(sigblob);
@@ -120,14 +120,14 @@ signature_test(struct sshkey *k, struct sshkey *bad, const char *sig_alg,
120 size_t len; 120 size_t len;
121 u_char *sig; 121 u_char *sig;
122 122
123 ASSERT_INT_EQ(sshkey_sign(k, &sig, &len, d, l, sig_alg, 0), 0); 123 ASSERT_INT_EQ(sshkey_sign(k, &sig, &len, d, l, sig_alg, NULL, 0), 0);
124 ASSERT_SIZE_T_GT(len, 8); 124 ASSERT_SIZE_T_GT(len, 8);
125 ASSERT_PTR_NE(sig, NULL); 125 ASSERT_PTR_NE(sig, NULL);
126 ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, NULL, 0), 0); 126 ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, NULL, 0, NULL), 0);
127 ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, NULL, 0), 0); 127 ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, NULL, 0, NULL), 0);
128 /* Fuzz test is more comprehensive, this is just a smoke test */ 128 /* Fuzz test is more comprehensive, this is just a smoke test */
129 sig[len - 5] ^= 0x10; 129 sig[len - 5] ^= 0x10;
130 ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, NULL, 0), 0); 130 ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, NULL, 0, NULL), 0);
131 free(sig); 131 free(sig);
132} 132}
133 133
@@ -437,7 +437,7 @@ sshkey_tests(void)
437 put_opt(k1->cert->extensions, "permit-X11-forwarding", NULL); 437 put_opt(k1->cert->extensions, "permit-X11-forwarding", NULL);
438 put_opt(k1->cert->extensions, "permit-agent-forwarding", NULL); 438 put_opt(k1->cert->extensions, "permit-agent-forwarding", NULL);
439 ASSERT_INT_EQ(sshkey_from_private(k2, &k1->cert->signature_key), 0); 439 ASSERT_INT_EQ(sshkey_from_private(k2, &k1->cert->signature_key), 0);
440 ASSERT_INT_EQ(sshkey_certify(k1, k2, NULL), 0); 440 ASSERT_INT_EQ(sshkey_certify(k1, k2, NULL, NULL), 0);
441 b = sshbuf_new(); 441 b = sshbuf_new();
442 ASSERT_PTR_NE(b, NULL); 442 ASSERT_PTR_NE(b, NULL);
443 ASSERT_INT_EQ(sshkey_putb(k1, b), 0); 443 ASSERT_INT_EQ(sshkey_putb(k1, b), 0);