summaryrefslogtreecommitdiff
path: root/regress/unittests/hostkeys/test_iterate.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/hostkeys/test_iterate.c')
-rw-r--r--regress/unittests/hostkeys/test_iterate.c249
1 files changed, 47 insertions, 202 deletions
diff --git a/regress/unittests/hostkeys/test_iterate.c b/regress/unittests/hostkeys/test_iterate.c
index 2eaaf063a..751825dda 100644
--- a/regress/unittests/hostkeys/test_iterate.c
+++ b/regress/unittests/hostkeys/test_iterate.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_iterate.c,v 1.4 2015/03/31 22:59:01 djm Exp $ */ 1/* $OpenBSD: test_iterate.c,v 1.5 2017/04/30 23:33:48 djm Exp $ */
2/* 2/*
3 * Regress test for hostfile.h hostkeys_foreach() 3 * Regress test for hostfile.h hostkeys_foreach()
4 * 4 *
@@ -90,14 +90,6 @@ check(struct hostkey_foreach_line *l, void *_ctx)
90 expected_keytype = (parse_key || expected->no_parse_keytype < 0) ? 90 expected_keytype = (parse_key || expected->no_parse_keytype < 0) ?
91 expected->l.keytype : expected->no_parse_keytype; 91 expected->l.keytype : expected->no_parse_keytype;
92 92
93#ifndef WITH_SSH1
94 if (parse_key && (expected->l.keytype == KEY_RSA1 ||
95 expected->no_parse_keytype == KEY_RSA1)) {
96 expected_status = HKF_STATUS_INVALID;
97 expected_keytype = KEY_UNSPEC;
98 parse_key = 0;
99 }
100#endif
101#ifndef OPENSSL_HAS_ECC 93#ifndef OPENSSL_HAS_ECC
102 if (expected->l.keytype == KEY_ECDSA || 94 if (expected->l.keytype == KEY_ECDSA ||
103 expected->no_parse_keytype == KEY_ECDSA) { 95 expected->no_parse_keytype == KEY_ECDSA) {
@@ -150,10 +142,6 @@ prepare_expected(struct expected *expected, size_t n)
150 for (i = 0; i < n; i++) { 142 for (i = 0; i < n; i++) {
151 if (expected[i].key_file == NULL) 143 if (expected[i].key_file == NULL)
152 continue; 144 continue;
153#ifndef WITH_SSH1
154 if (expected[i].l.keytype == KEY_RSA1)
155 continue;
156#endif
157#ifndef OPENSSL_HAS_ECC 145#ifndef OPENSSL_HAS_ECC
158 if (expected[i].l.keytype == KEY_ECDSA) 146 if (expected[i].l.keytype == KEY_ECDSA)
159 continue; 147 continue;
@@ -217,22 +205,9 @@ struct expected expected_full[] = {
217 NULL, /* filled at runtime */ 205 NULL, /* filled at runtime */
218 "ED25519 #1", 206 "ED25519 #1",
219 } }, 207 } },
220 { "rsa1_1.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
221 NULL,
222 5,
223 HKF_STATUS_OK,
224 0,
225 NULL,
226 MRK_NONE,
227 "sisyphus.example.com",
228 NULL,
229 KEY_RSA1,
230 NULL, /* filled at runtime */
231 "RSA1 #1",
232 } },
233 { "rsa_1.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, { 208 { "rsa_1.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
234 NULL, 209 NULL,
235 6, 210 5,
236 HKF_STATUS_OK, 211 HKF_STATUS_OK,
237 0, 212 0,
238 NULL, 213 NULL,
@@ -245,7 +220,7 @@ struct expected expected_full[] = {
245 } }, 220 } },
246 { NULL, -1, -1, 0, 0, 0, 0, -1, { 221 { NULL, -1, -1, 0, 0, 0, 0, -1, {
247 NULL, 222 NULL,
248 7, 223 6,
249 HKF_STATUS_COMMENT, 224 HKF_STATUS_COMMENT,
250 0, 225 0,
251 "", 226 "",
@@ -258,7 +233,7 @@ struct expected expected_full[] = {
258 } }, 233 } },
259 { NULL, -1, -1, 0, 0, 0, 0, -1, { 234 { NULL, -1, -1, 0, 0, 0, 0, -1, {
260 NULL, 235 NULL,
261 8, 236 7,
262 HKF_STATUS_COMMENT, 237 HKF_STATUS_COMMENT,
263 0, 238 0,
264 "# Plain host keys, hostnames + addresses", 239 "# Plain host keys, hostnames + addresses",
@@ -271,7 +246,7 @@ struct expected expected_full[] = {
271 } }, 246 } },
272 { "dsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 247 { "dsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
273 NULL, 248 NULL,
274 9, 249 8,
275 HKF_STATUS_OK, 250 HKF_STATUS_OK,
276 0, 251 0,
277 NULL, 252 NULL,
@@ -284,7 +259,7 @@ struct expected expected_full[] = {
284 } }, 259 } },
285 { "ecdsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 260 { "ecdsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
286 NULL, 261 NULL,
287 10, 262 9,
288 HKF_STATUS_OK, 263 HKF_STATUS_OK,
289 0, 264 0,
290 NULL, 265 NULL,
@@ -297,7 +272,7 @@ struct expected expected_full[] = {
297 } }, 272 } },
298 { "ed25519_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 273 { "ed25519_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
299 NULL, 274 NULL,
300 11, 275 10,
301 HKF_STATUS_OK, 276 HKF_STATUS_OK,
302 0, 277 0,
303 NULL, 278 NULL,
@@ -308,22 +283,9 @@ struct expected expected_full[] = {
308 NULL, /* filled at runtime */ 283 NULL, /* filled at runtime */
309 "ED25519 #2", 284 "ED25519 #2",
310 } }, 285 } },
311 { "rsa1_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
312 NULL,
313 12,
314 HKF_STATUS_OK,
315 0,
316 NULL,
317 MRK_NONE,
318 "prometheus.example.com,192.0.2.1,2001:db8::1",
319 NULL,
320 KEY_RSA1,
321 NULL, /* filled at runtime */
322 "RSA1 #2",
323 } },
324 { "rsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 286 { "rsa_2.pub" , -1, -1, HKF_MATCH_HOST, 0, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
325 NULL, 287 NULL,
326 13, 288 11,
327 HKF_STATUS_OK, 289 HKF_STATUS_OK,
328 0, 290 0,
329 NULL, 291 NULL,
@@ -336,7 +298,7 @@ struct expected expected_full[] = {
336 } }, 298 } },
337 { NULL, -1, -1, 0, 0, 0, 0, -1, { 299 { NULL, -1, -1, 0, 0, 0, 0, -1, {
338 NULL, 300 NULL,
339 14, 301 12,
340 HKF_STATUS_COMMENT, 302 HKF_STATUS_COMMENT,
341 0, 303 0,
342 "", 304 "",
@@ -349,7 +311,7 @@ struct expected expected_full[] = {
349 } }, 311 } },
350 { NULL, -1, -1, 0, 0, 0, 0, -1, { 312 { NULL, -1, -1, 0, 0, 0, 0, -1, {
351 NULL, 313 NULL,
352 15, 314 13,
353 HKF_STATUS_COMMENT, 315 HKF_STATUS_COMMENT,
354 0, 316 0,
355 "# Some hosts with wildcard names / IPs", 317 "# Some hosts with wildcard names / IPs",
@@ -362,7 +324,7 @@ struct expected expected_full[] = {
362 } }, 324 } },
363 { "dsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 325 { "dsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
364 NULL, 326 NULL,
365 16, 327 14,
366 HKF_STATUS_OK, 328 HKF_STATUS_OK,
367 0, 329 0,
368 NULL, 330 NULL,
@@ -375,7 +337,7 @@ struct expected expected_full[] = {
375 } }, 337 } },
376 { "ecdsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 338 { "ecdsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
377 NULL, 339 NULL,
378 17, 340 15,
379 HKF_STATUS_OK, 341 HKF_STATUS_OK,
380 0, 342 0,
381 NULL, 343 NULL,
@@ -388,7 +350,7 @@ struct expected expected_full[] = {
388 } }, 350 } },
389 { "ed25519_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 351 { "ed25519_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
390 NULL, 352 NULL,
391 18, 353 16,
392 HKF_STATUS_OK, 354 HKF_STATUS_OK,
393 0, 355 0,
394 NULL, 356 NULL,
@@ -399,22 +361,9 @@ struct expected expected_full[] = {
399 NULL, /* filled at runtime */ 361 NULL, /* filled at runtime */
400 "ED25519 #3", 362 "ED25519 #3",
401 } }, 363 } },
402 { "rsa1_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
403 NULL,
404 19,
405 HKF_STATUS_OK,
406 0,
407 NULL,
408 MRK_NONE,
409 "*.example.com,192.0.2.*,2001:*",
410 NULL,
411 KEY_RSA1,
412 NULL, /* filled at runtime */
413 "RSA1 #3",
414 } },
415 { "rsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, { 364 { "rsa_3.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, HKF_MATCH_IP, HKF_MATCH_IP, -1, {
416 NULL, 365 NULL,
417 20, 366 17,
418 HKF_STATUS_OK, 367 HKF_STATUS_OK,
419 0, 368 0,
420 NULL, 369 NULL,
@@ -427,7 +376,7 @@ struct expected expected_full[] = {
427 } }, 376 } },
428 { NULL, -1, -1, 0, 0, 0, 0, -1, { 377 { NULL, -1, -1, 0, 0, 0, 0, -1, {
429 NULL, 378 NULL,
430 21, 379 18,
431 HKF_STATUS_COMMENT, 380 HKF_STATUS_COMMENT,
432 0, 381 0,
433 "", 382 "",
@@ -440,7 +389,7 @@ struct expected expected_full[] = {
440 } }, 389 } },
441 { NULL, -1, -1, 0, 0, 0, 0, -1, { 390 { NULL, -1, -1, 0, 0, 0, 0, -1, {
442 NULL, 391 NULL,
443 22, 392 19,
444 HKF_STATUS_COMMENT, 393 HKF_STATUS_COMMENT,
445 0, 394 0,
446 "# Hashed hostname and address entries", 395 "# Hashed hostname and address entries",
@@ -453,7 +402,7 @@ struct expected expected_full[] = {
453 } }, 402 } },
454 { "dsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, { 403 { "dsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, {
455 NULL, 404 NULL,
456 23, 405 20,
457 HKF_STATUS_OK, 406 HKF_STATUS_OK,
458 0, 407 0,
459 NULL, 408 NULL,
@@ -466,7 +415,7 @@ struct expected expected_full[] = {
466 } }, 415 } },
467 { "ecdsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, { 416 { "ecdsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, {
468 NULL, 417 NULL,
469 24, 418 21,
470 HKF_STATUS_OK, 419 HKF_STATUS_OK,
471 0, 420 0,
472 NULL, 421 NULL,
@@ -479,7 +428,7 @@ struct expected expected_full[] = {
479 } }, 428 } },
480 { "ed25519_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, { 429 { "ed25519_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, {
481 NULL, 430 NULL,
482 25, 431 22,
483 HKF_STATUS_OK, 432 HKF_STATUS_OK,
484 0, 433 0,
485 NULL, 434 NULL,
@@ -490,22 +439,9 @@ struct expected expected_full[] = {
490 NULL, /* filled at runtime */ 439 NULL, /* filled at runtime */
491 "ED25519 #5", 440 "ED25519 #5",
492 } }, 441 } },
493 { "rsa1_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, {
494 NULL,
495 26,
496 HKF_STATUS_OK,
497 0,
498 NULL,
499 MRK_NONE,
500 NULL,
501 NULL,
502 KEY_RSA1,
503 NULL, /* filled at runtime */
504 "RSA1 #5",
505 } },
506 { "rsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, { 442 { "rsa_5.pub" , -1, -1, 0, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, -1, {
507 NULL, 443 NULL,
508 27, 444 23,
509 HKF_STATUS_OK, 445 HKF_STATUS_OK,
510 0, 446 0,
511 NULL, 447 NULL,
@@ -518,7 +454,7 @@ struct expected expected_full[] = {
518 } }, 454 } },
519 { NULL, -1, -1, 0, 0, 0, 0, -1, { 455 { NULL, -1, -1, 0, 0, 0, 0, -1, {
520 NULL, 456 NULL,
521 28, 457 24,
522 HKF_STATUS_COMMENT, 458 HKF_STATUS_COMMENT,
523 0, 459 0,
524 "", 460 "",
@@ -536,7 +472,7 @@ struct expected expected_full[] = {
536 */ 472 */
537 { "dsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, { 473 { "dsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, {
538 NULL, 474 NULL,
539 29, 475 25,
540 HKF_STATUS_OK, 476 HKF_STATUS_OK,
541 0, 477 0,
542 NULL, 478 NULL,
@@ -549,7 +485,7 @@ struct expected expected_full[] = {
549 } }, 485 } },
550 { "dsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, { 486 { "dsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, {
551 NULL, 487 NULL,
552 30, 488 26,
553 HKF_STATUS_OK, 489 HKF_STATUS_OK,
554 0, 490 0,
555 NULL, 491 NULL,
@@ -562,7 +498,7 @@ struct expected expected_full[] = {
562 } }, 498 } },
563 { "dsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, { 499 { "dsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, {
564 NULL, 500 NULL,
565 31, 501 27,
566 HKF_STATUS_OK, 502 HKF_STATUS_OK,
567 0, 503 0,
568 NULL, 504 NULL,
@@ -575,7 +511,7 @@ struct expected expected_full[] = {
575 } }, 511 } },
576 { "ecdsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, { 512 { "ecdsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, {
577 NULL, 513 NULL,
578 32, 514 28,
579 HKF_STATUS_OK, 515 HKF_STATUS_OK,
580 0, 516 0,
581 NULL, 517 NULL,
@@ -588,7 +524,7 @@ struct expected expected_full[] = {
588 } }, 524 } },
589 { "ecdsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, { 525 { "ecdsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, {
590 NULL, 526 NULL,
591 33, 527 29,
592 HKF_STATUS_OK, 528 HKF_STATUS_OK,
593 0, 529 0,
594 NULL, 530 NULL,
@@ -601,7 +537,7 @@ struct expected expected_full[] = {
601 } }, 537 } },
602 { "ecdsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, { 538 { "ecdsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, {
603 NULL, 539 NULL,
604 34, 540 30,
605 HKF_STATUS_OK, 541 HKF_STATUS_OK,
606 0, 542 0,
607 NULL, 543 NULL,
@@ -614,7 +550,7 @@ struct expected expected_full[] = {
614 } }, 550 } },
615 { "ed25519_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, { 551 { "ed25519_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, {
616 NULL, 552 NULL,
617 35, 553 31,
618 HKF_STATUS_OK, 554 HKF_STATUS_OK,
619 0, 555 0,
620 NULL, 556 NULL,
@@ -627,7 +563,7 @@ struct expected expected_full[] = {
627 } }, 563 } },
628 { "ed25519_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, { 564 { "ed25519_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, {
629 NULL, 565 NULL,
630 36, 566 32,
631 HKF_STATUS_OK, 567 HKF_STATUS_OK,
632 0, 568 0,
633 NULL, 569 NULL,
@@ -640,7 +576,7 @@ struct expected expected_full[] = {
640 } }, 576 } },
641 { "ed25519_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, { 577 { "ed25519_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, {
642 NULL, 578 NULL,
643 37, 579 33,
644 HKF_STATUS_OK, 580 HKF_STATUS_OK,
645 0, 581 0,
646 NULL, 582 NULL,
@@ -651,48 +587,9 @@ struct expected expected_full[] = {
651 NULL, /* filled at runtime */ 587 NULL, /* filled at runtime */
652 "ED25519 #6", 588 "ED25519 #6",
653 } }, 589 } },
654 { "rsa1_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, {
655 NULL,
656 38,
657 HKF_STATUS_OK,
658 0,
659 NULL,
660 MRK_NONE,
661 NULL,
662 NULL,
663 KEY_RSA1,
664 NULL, /* filled at runtime */
665 "RSA1 #6",
666 } },
667 { "rsa1_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, {
668 NULL,
669 39,
670 HKF_STATUS_OK,
671 0,
672 NULL,
673 MRK_NONE,
674 NULL,
675 NULL,
676 KEY_RSA1,
677 NULL, /* filled at runtime */
678 "RSA1 #6",
679 } },
680 { "rsa1_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, {
681 NULL,
682 40,
683 HKF_STATUS_OK,
684 0,
685 NULL,
686 MRK_NONE,
687 NULL,
688 NULL,
689 KEY_RSA1,
690 NULL, /* filled at runtime */
691 "RSA1 #6",
692 } },
693 { "rsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, { 590 { "rsa_6.pub" , -1, -1, HKF_MATCH_HOST|HKF_MATCH_HOST_HASHED, 0, 0, 0, -1, {
694 NULL, 591 NULL,
695 41, 592 34,
696 HKF_STATUS_OK, 593 HKF_STATUS_OK,
697 0, 594 0,
698 NULL, 595 NULL,
@@ -705,7 +602,7 @@ struct expected expected_full[] = {
705 } }, 602 } },
706 { "rsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, { 603 { "rsa_6.pub" , -1, -1, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, 0, -1, {
707 NULL, 604 NULL,
708 42, 605 35,
709 HKF_STATUS_OK, 606 HKF_STATUS_OK,
710 0, 607 0,
711 NULL, 608 NULL,
@@ -718,7 +615,7 @@ struct expected expected_full[] = {
718 } }, 615 } },
719 { "rsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, { 616 { "rsa_6.pub" , -1, -1, 0, 0, 0, HKF_MATCH_IP|HKF_MATCH_IP_HASHED, -1, {
720 NULL, 617 NULL,
721 43, 618 36,
722 HKF_STATUS_OK, 619 HKF_STATUS_OK,
723 0, 620 0,
724 NULL, 621 NULL,
@@ -731,7 +628,7 @@ struct expected expected_full[] = {
731 } }, 628 } },
732 { NULL, -1, -1, 0, 0, 0, 0, -1, { 629 { NULL, -1, -1, 0, 0, 0, 0, -1, {
733 NULL, 630 NULL,
734 44, 631 37,
735 HKF_STATUS_COMMENT, 632 HKF_STATUS_COMMENT,
736 0, 633 0,
737 "", 634 "",
@@ -744,7 +641,7 @@ struct expected expected_full[] = {
744 } }, 641 } },
745 { NULL, -1, -1, 0, 0, 0, 0, -1, { 642 { NULL, -1, -1, 0, 0, 0, 0, -1, {
746 NULL, 643 NULL,
747 45, 644 38,
748 HKF_STATUS_COMMENT, 645 HKF_STATUS_COMMENT,
749 0, 646 0,
750 "", 647 "",
@@ -757,7 +654,7 @@ struct expected expected_full[] = {
757 } }, 654 } },
758 { NULL, -1, -1, 0, 0, 0, 0, -1, { 655 { NULL, -1, -1, 0, 0, 0, 0, -1, {
759 NULL, 656 NULL,
760 46, 657 39,
761 HKF_STATUS_COMMENT, 658 HKF_STATUS_COMMENT,
762 0, 659 0,
763 "# Revoked and CA keys", 660 "# Revoked and CA keys",
@@ -768,22 +665,9 @@ struct expected expected_full[] = {
768 NULL, 665 NULL,
769 NULL, 666 NULL,
770 } }, 667 } },
771 { "rsa1_4.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
772 NULL,
773 47,
774 HKF_STATUS_OK,
775 0,
776 NULL,
777 MRK_REVOKE,
778 "sisyphus.example.com",
779 NULL,
780 KEY_RSA1,
781 NULL, /* filled at runtime */
782 "RSA1 #4",
783 } },
784 { "ed25519_4.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, { 668 { "ed25519_4.pub" , -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
785 NULL, 669 NULL,
786 48, 670 40,
787 HKF_STATUS_OK, 671 HKF_STATUS_OK,
788 0, 672 0,
789 NULL, 673 NULL,
@@ -796,7 +680,7 @@ struct expected expected_full[] = {
796 } }, 680 } },
797 { "ecdsa_4.pub" , -1, -1, HKF_MATCH_HOST, 0, 0, 0, -1, { 681 { "ecdsa_4.pub" , -1, -1, HKF_MATCH_HOST, 0, 0, 0, -1, {
798 NULL, 682 NULL,
799 49, 683 41,
800 HKF_STATUS_OK, 684 HKF_STATUS_OK,
801 0, 685 0,
802 NULL, 686 NULL,
@@ -809,7 +693,7 @@ struct expected expected_full[] = {
809 } }, 693 } },
810 { "dsa_4.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, 0, 0, -1, { 694 { "dsa_4.pub" , -1, -1, HKF_MATCH_HOST, HKF_MATCH_HOST, 0, 0, -1, {
811 NULL, 695 NULL,
812 50, 696 42,
813 HKF_STATUS_OK, 697 HKF_STATUS_OK,
814 0, 698 0,
815 NULL, 699 NULL,
@@ -822,7 +706,7 @@ struct expected expected_full[] = {
822 } }, 706 } },
823 { NULL, -1, -1, 0, 0, 0, 0, -1, { 707 { NULL, -1, -1, 0, 0, 0, 0, -1, {
824 NULL, 708 NULL,
825 51, 709 43,
826 HKF_STATUS_COMMENT, 710 HKF_STATUS_COMMENT,
827 0, 711 0,
828 "", 712 "",
@@ -835,7 +719,7 @@ struct expected expected_full[] = {
835 } }, 719 } },
836 { NULL, -1, -1, 0, 0, 0, 0, -1, { 720 { NULL, -1, -1, 0, 0, 0, 0, -1, {
837 NULL, 721 NULL,
838 52, 722 44,
839 HKF_STATUS_COMMENT, 723 HKF_STATUS_COMMENT,
840 0, 724 0,
841 "# Some invalid lines", 725 "# Some invalid lines",
@@ -848,7 +732,7 @@ struct expected expected_full[] = {
848 } }, 732 } },
849 { NULL, -1, -1, 0, 0, 0, 0, -1, { 733 { NULL, -1, -1, 0, 0, 0, 0, -1, {
850 NULL, 734 NULL,
851 53, 735 45,
852 HKF_STATUS_INVALID, 736 HKF_STATUS_INVALID,
853 0, 737 0,
854 NULL, 738 NULL,
@@ -861,7 +745,7 @@ struct expected expected_full[] = {
861 } }, 745 } },
862 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, { 746 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
863 NULL, 747 NULL,
864 54, 748 46,
865 HKF_STATUS_INVALID, 749 HKF_STATUS_INVALID,
866 0, 750 0,
867 NULL, 751 NULL,
@@ -874,7 +758,7 @@ struct expected expected_full[] = {
874 } }, 758 } },
875 { NULL, -1, -1, HKF_MATCH_HOST, 0, 0, 0, -1, { 759 { NULL, -1, -1, HKF_MATCH_HOST, 0, 0, 0, -1, {
876 NULL, 760 NULL,
877 55, 761 47,
878 HKF_STATUS_INVALID, 762 HKF_STATUS_INVALID,
879 0, 763 0,
880 NULL, 764 NULL,
@@ -887,33 +771,7 @@ struct expected expected_full[] = {
887 } }, 771 } },
888 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, { 772 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
889 NULL, 773 NULL,
890 56, 774 48,
891 HKF_STATUS_INVALID, /* Would be ok if key not parsed */
892 0,
893 NULL,
894 MRK_NONE,
895 "sisyphus.example.com",
896 NULL,
897 KEY_UNSPEC,
898 NULL,
899 NULL,
900 } },
901 { NULL, -1, -1, HKF_MATCH_HOST, 0, 0, 0, -1, {
902 NULL,
903 57,
904 HKF_STATUS_INVALID, /* Would be ok if key not parsed */
905 0,
906 NULL,
907 MRK_NONE,
908 "prometheus.example.com",
909 NULL,
910 KEY_UNSPEC,
911 NULL,
912 NULL,
913 } },
914 { NULL, HKF_STATUS_OK, KEY_RSA1, 0, HKF_MATCH_HOST, 0, 0, -1, {
915 NULL,
916 58,
917 HKF_STATUS_INVALID, /* Would be ok if key not parsed */ 775 HKF_STATUS_INVALID, /* Would be ok if key not parsed */
918 0, 776 0,
919 NULL, 777 NULL,
@@ -924,22 +782,9 @@ struct expected expected_full[] = {
924 NULL, 782 NULL,
925 NULL, 783 NULL,
926 } }, 784 } },
927 { NULL, HKF_STATUS_OK, KEY_RSA1, HKF_MATCH_HOST, 0, 0, 0, -1, {
928 NULL,
929 59,
930 HKF_STATUS_INVALID, /* Would be ok if key not parsed */
931 0,
932 NULL,
933 MRK_NONE,
934 "prometheus.example.com",
935 NULL,
936 KEY_UNSPEC,
937 NULL, /* filled at runtime */
938 NULL,
939 } },
940 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, { 785 { NULL, -1, -1, 0, HKF_MATCH_HOST, 0, 0, -1, {
941 NULL, 786 NULL,
942 60, 787 49,
943 HKF_STATUS_INVALID, 788 HKF_STATUS_INVALID,
944 0, 789 0,
945 NULL, 790 NULL,
@@ -952,7 +797,7 @@ struct expected expected_full[] = {
952 } }, 797 } },
953 { NULL, HKF_STATUS_OK, KEY_RSA, HKF_MATCH_HOST, 0, 0, 0, -1, { 798 { NULL, HKF_STATUS_OK, KEY_RSA, HKF_MATCH_HOST, 0, 0, 0, -1, {
954 NULL, 799 NULL,
955 61, 800 50,
956 HKF_STATUS_INVALID, /* Would be ok if key not parsed */ 801 HKF_STATUS_INVALID, /* Would be ok if key not parsed */
957 0, 802 0,
958 NULL, 803 NULL,