Lines Matching full:auth
39 #include "auth.h"
106 dhcp_auth_validate(struct authstate *state, const struct auth *auth,
134 if (!(auth->options & DHCPCD_AUTH_SEND)) {
141 } else if (protocol != auth->protocol ||
142 algorithm != auth->algorithm ||
143 rdm != auth->rdm)
148 auth->options & DHCPCD_AUTH_REQUIRE)
274 TAILQ_FOREACH(t, &auth->tokens, next) {
388 get_next_rdm_monotonic_counter(struct auth *auth)
399 return ++auth->last_replay; /* report error? */
402 return ++auth->last_replay; /* report error? */
420 if (!auth->last_replay_set) {
421 auth->last_replay = rdm;
422 auth->last_replay_set = 1;
424 rdm = ++auth->last_replay;
438 get_next_rdm_monotonic_clock(struct auth *auth)
446 return ++auth->last_replay; /* report error? */
456 get_next_rdm_monotonic(struct auth *auth)
459 if (auth->options & DHCPCD_AUTH_RDM_COUNTER)
460 return get_next_rdm_monotonic_counter(auth);
461 return get_next_rdm_monotonic_clock(auth);
475 dhcp_auth_encode(struct auth *auth, const struct token *t,
485 if (auth->protocol == 0 && t == NULL) {
486 TAILQ_FOREACH(t, &auth->tokens, next) {
505 switch(auth->protocol) {
516 switch(auth->algorithm) {
524 switch(auth->rdm) {
532 /* DISCOVER or INFORM messages don't write auth info */
539 /* Work out the auth area size.
543 switch(auth->protocol) {
571 *data++ = auth->protocol;
572 *data++ = auth->algorithm;
573 *data++ = auth->rdm;
574 switch (auth->rdm) {
576 rdm = get_next_rdm_monotonic(auth);
580 rdm = get_next_rdm_monotonic(auth);
589 if (auth->protocol == AUTH_PROTO_TOKEN) {
603 /* DISCOVER or INFORM messages don't write auth info */
612 if (auth->protocol == AUTH_PROTO_DELAYEDREALM) {
623 if (auth->protocol == AUTH_PROTO_DELAYED ||
624 auth->protocol == AUTH_PROTO_DELAYEDREALM)
654 switch(auth->algorithm) {