summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/test_sshkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/sshkey/test_sshkey.c')
-rw-r--r--regress/unittests/sshkey/test_sshkey.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 8e35f4417..47a03fad4 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.16 2018/09/13 05:06:51 djm Exp $ */ 1/* $OpenBSD: test_sshkey.c,v 1.17 2018/09/13 09:03:20 djm Exp $ */
2/* 2/*
3 * Regress test for sshkey.h key management API 3 * Regress test for sshkey.h key management API
4 * 4 *
@@ -173,61 +173,6 @@ get_private(const char *n)
173 return ret; 173 return ret;
174} 174}
175 175
176static const BIGNUM *
177rsa_n(struct sshkey *k)
178{
179 const BIGNUM *n = NULL;
180
181 ASSERT_PTR_NE(k, NULL);
182 ASSERT_PTR_NE(k->rsa, NULL);
183 RSA_get0_key(k->rsa, &n, NULL, NULL);
184 return n;
185}
186
187static const BIGNUM *
188rsa_e(struct sshkey *k)
189{
190 const BIGNUM *e = NULL;
191
192 ASSERT_PTR_NE(k, NULL);
193 ASSERT_PTR_NE(k->rsa, NULL);
194 RSA_get0_key(k->rsa, NULL, &e, NULL);
195 return e;
196}
197
198static const BIGNUM *
199rsa_p(struct sshkey *k)
200{
201 const BIGNUM *p = NULL;
202
203 ASSERT_PTR_NE(k, NULL);
204 ASSERT_PTR_NE(k->rsa, NULL);
205 RSA_get0_factors(k->rsa, &p, NULL);
206 return p;
207}
208
209static const BIGNUM *
210dsa_g(struct sshkey *k)
211{
212 const BIGNUM *g = NULL;
213
214 ASSERT_PTR_NE(k, NULL);
215 ASSERT_PTR_NE(k->dsa, NULL);
216 DSA_get0_pqg(k->dsa, NULL, NULL, &g);
217 return g;
218}
219
220static const BIGNUM *
221dsa_priv_key(struct sshkey *k)
222{
223 const BIGNUM *priv_key = NULL;
224
225 ASSERT_PTR_NE(k, NULL);
226 ASSERT_PTR_NE(k->dsa, NULL);
227 DSA_get0_key(k->dsa, NULL, &priv_key);
228 return priv_key;
229}
230
231void 176void
232sshkey_tests(void) 177sshkey_tests(void)
233{ 178{