Lines Matching refs:auth
106 dhcp_auth_validate(struct authstate *state, const struct auth *auth, in dhcp_auth_validate() argument
134 if (!(auth->options & DHCPCD_AUTH_SEND)) { in dhcp_auth_validate()
141 } else if (protocol != auth->protocol || in dhcp_auth_validate()
142 algorithm != auth->algorithm || in dhcp_auth_validate()
143 rdm != auth->rdm) in dhcp_auth_validate()
148 auth->options & DHCPCD_AUTH_REQUIRE) in dhcp_auth_validate()
274 TAILQ_FOREACH(t, &auth->tokens, next) { in dhcp_auth_validate()
388 get_next_rdm_monotonic_counter(struct auth *auth) in get_next_rdm_monotonic_counter() argument
399 return ++auth->last_replay; /* report error? */ in get_next_rdm_monotonic_counter()
402 return ++auth->last_replay; /* report error? */ in get_next_rdm_monotonic_counter()
420 if (!auth->last_replay_set) { in get_next_rdm_monotonic_counter()
421 auth->last_replay = rdm; in get_next_rdm_monotonic_counter()
422 auth->last_replay_set = 1; in get_next_rdm_monotonic_counter()
424 rdm = ++auth->last_replay; in get_next_rdm_monotonic_counter()
438 get_next_rdm_monotonic_clock(struct auth *auth) in get_next_rdm_monotonic_clock() argument
446 return ++auth->last_replay; /* report error? */ in get_next_rdm_monotonic_clock()
456 get_next_rdm_monotonic(struct auth *auth) in get_next_rdm_monotonic() argument
459 if (auth->options & DHCPCD_AUTH_RDM_COUNTER) in get_next_rdm_monotonic()
460 return get_next_rdm_monotonic_counter(auth); in get_next_rdm_monotonic()
461 return get_next_rdm_monotonic_clock(auth); in get_next_rdm_monotonic()
475 dhcp_auth_encode(struct auth *auth, const struct token *t, in dhcp_auth_encode() argument
485 if (auth->protocol == 0 && t == NULL) { in dhcp_auth_encode()
486 TAILQ_FOREACH(t, &auth->tokens, next) { in dhcp_auth_encode()
505 switch(auth->protocol) { in dhcp_auth_encode()
516 switch(auth->algorithm) { in dhcp_auth_encode()
524 switch(auth->rdm) { in dhcp_auth_encode()
543 switch(auth->protocol) { in dhcp_auth_encode()
571 *data++ = auth->protocol; in dhcp_auth_encode()
572 *data++ = auth->algorithm; in dhcp_auth_encode()
573 *data++ = auth->rdm; in dhcp_auth_encode()
574 switch (auth->rdm) { in dhcp_auth_encode()
576 rdm = get_next_rdm_monotonic(auth); in dhcp_auth_encode()
580 rdm = get_next_rdm_monotonic(auth); in dhcp_auth_encode()
589 if (auth->protocol == AUTH_PROTO_TOKEN) { in dhcp_auth_encode()
612 if (auth->protocol == AUTH_PROTO_DELAYEDREALM) { in dhcp_auth_encode()
623 if (auth->protocol == AUTH_PROTO_DELAYED || in dhcp_auth_encode()
624 auth->protocol == AUTH_PROTO_DELAYEDREALM) in dhcp_auth_encode()
654 switch(auth->algorithm) { in dhcp_auth_encode()