| 534 | } |
| 535 | |
| 536 | static uint64_t |
| 537 | tcp_fastopen_make_cookie(uint8_t key[SIPHASH_KEY_LENGTH], struct in_conninfo *inc) |
| 538 | { |
| 539 | SIPHASH_CTX ctx; |
| 540 | uint64_t siphash; |
| 541 | |
| 542 | SipHash24_Init(&ctx); |
| 543 | SipHash_SetKey(&ctx, key); |
| 544 | switch (inc->inc_flags & INC_ISIPV6) { |
| 545 | #ifdef INET |
| 546 | case 0: |
| 547 | SipHash_Update(&ctx, &inc->inc_faddr, sizeof(inc->inc_faddr)); |
| 548 | break; |
| 549 | #endif |
| 550 | #ifdef INET6 |
| 551 | case INC_ISIPV6: |
| 552 | SipHash_Update(&ctx, &inc->inc6_faddr, sizeof(inc->inc6_faddr)); |
| 553 | break; |
| 554 | #endif |
| 555 | } |
| 556 | SipHash_Final((u_int8_t *)&siphash, &ctx); |
| 557 | |
| 558 | return (siphash); |
| 559 | } |
| 560 | |
| 561 | static uint64_t |
| 562 | tcp_fastopen_make_psk_cookie(uint8_t *psk, uint8_t *cookie, uint8_t cookie_len) |
no test coverage detected