Lines Matching refs:token

56 	struct rxrpc_key_token *token, **pptoken;  in rxrpc_preparse_xdr_rxkad()  local
74 plen = sizeof(*token) + sizeof(*token->kad) + tktlen; in rxrpc_preparse_xdr_rxkad()
77 plen -= sizeof(*token); in rxrpc_preparse_xdr_rxkad()
78 token = kzalloc(sizeof(*token), GFP_KERNEL); in rxrpc_preparse_xdr_rxkad()
79 if (!token) in rxrpc_preparse_xdr_rxkad()
82 token->kad = kzalloc(plen, GFP_KERNEL); in rxrpc_preparse_xdr_rxkad()
83 if (!token->kad) { in rxrpc_preparse_xdr_rxkad()
84 kfree(token); in rxrpc_preparse_xdr_rxkad()
88 token->security_index = RXRPC_SECURITY_RXKAD; in rxrpc_preparse_xdr_rxkad()
89 token->kad->ticket_len = tktlen; in rxrpc_preparse_xdr_rxkad()
90 token->kad->vice_id = ntohl(xdr[0]); in rxrpc_preparse_xdr_rxkad()
91 token->kad->kvno = ntohl(xdr[1]); in rxrpc_preparse_xdr_rxkad()
92 token->kad->start = ntohl(xdr[4]); in rxrpc_preparse_xdr_rxkad()
93 token->kad->expiry = ntohl(xdr[5]); in rxrpc_preparse_xdr_rxkad()
94 token->kad->primary_flag = ntohl(xdr[6]); in rxrpc_preparse_xdr_rxkad()
95 memcpy(&token->kad->session_key, &xdr[2], 8); in rxrpc_preparse_xdr_rxkad()
96 memcpy(&token->kad->ticket, &xdr[8], tktlen); in rxrpc_preparse_xdr_rxkad()
98 _debug("SCIX: %u", token->security_index); in rxrpc_preparse_xdr_rxkad()
99 _debug("TLEN: %u", token->kad->ticket_len); in rxrpc_preparse_xdr_rxkad()
100 _debug("EXPY: %x", token->kad->expiry); in rxrpc_preparse_xdr_rxkad()
101 _debug("KVNO: %u", token->kad->kvno); in rxrpc_preparse_xdr_rxkad()
102 _debug("PRIM: %u", token->kad->primary_flag); in rxrpc_preparse_xdr_rxkad()
104 token->kad->session_key[0], token->kad->session_key[1], in rxrpc_preparse_xdr_rxkad()
105 token->kad->session_key[2], token->kad->session_key[3], in rxrpc_preparse_xdr_rxkad()
106 token->kad->session_key[4], token->kad->session_key[5], in rxrpc_preparse_xdr_rxkad()
107 token->kad->session_key[6], token->kad->session_key[7]); in rxrpc_preparse_xdr_rxkad()
108 if (token->kad->ticket_len >= 8) in rxrpc_preparse_xdr_rxkad()
110 token->kad->ticket[0], token->kad->ticket[1], in rxrpc_preparse_xdr_rxkad()
111 token->kad->ticket[2], token->kad->ticket[3], in rxrpc_preparse_xdr_rxkad()
112 token->kad->ticket[4], token->kad->ticket[5], in rxrpc_preparse_xdr_rxkad()
113 token->kad->ticket[6], token->kad->ticket[7]); in rxrpc_preparse_xdr_rxkad()
123 *pptoken = token; in rxrpc_preparse_xdr_rxkad()
124 expiry = rxrpc_u32_to_time64(token->kad->expiry); in rxrpc_preparse_xdr_rxkad()
138 const __be32 *xdr = prep->data, *token, *p; in rxrpc_preparse_xdr() local
219 token = xdr; in rxrpc_preparse_xdr()
222 sec_ix = ntohl(*token++); in rxrpc_preparse_xdr()
229 ret2 = rxrpc_preparse_xdr_rxkad(prep, datalen, token, toklen); in rxrpc_preparse_xdr()
280 struct rxrpc_key_token *token, **pp; in rxrpc_preparse() local
342 plen = sizeof(*token->kad) + v1->ticket_length; in rxrpc_preparse()
343 prep->quotalen = plen + sizeof(*token); in rxrpc_preparse()
346 token = kzalloc(sizeof(*token), GFP_KERNEL); in rxrpc_preparse()
347 if (!token) in rxrpc_preparse()
349 token->kad = kzalloc(plen, GFP_KERNEL); in rxrpc_preparse()
350 if (!token->kad) in rxrpc_preparse()
353 token->security_index = RXRPC_SECURITY_RXKAD; in rxrpc_preparse()
354 token->kad->ticket_len = v1->ticket_length; in rxrpc_preparse()
355 token->kad->expiry = v1->expiry; in rxrpc_preparse()
356 token->kad->kvno = v1->kvno; in rxrpc_preparse()
357 memcpy(&token->kad->session_key, &v1->session_key, 8); in rxrpc_preparse()
358 memcpy(&token->kad->ticket, v1->ticket, v1->ticket_length); in rxrpc_preparse()
367 *pp = token; in rxrpc_preparse()
368 expiry = rxrpc_u32_to_time64(token->kad->expiry); in rxrpc_preparse()
371 token = NULL; in rxrpc_preparse()
375 kfree(token); in rxrpc_preparse()
383 static void rxrpc_free_token_list(struct rxrpc_key_token *token) in rxrpc_free_token_list() argument
387 for (; token; token = next) { in rxrpc_free_token_list()
388 next = token->next; in rxrpc_free_token_list()
389 switch (token->security_index) { in rxrpc_free_token_list()
391 kfree(token->kad); in rxrpc_free_token_list()
395 token->security_index); in rxrpc_free_token_list()
399 kfree(token); in rxrpc_free_token_list()
424 const struct rxrpc_key_token *token; in rxrpc_describe() local
429 for (token = key->payload.data[0]; token; token = token->next) { in rxrpc_describe()
432 switch (token->security_index) { in rxrpc_describe()
437 seq_printf(m, "%u", token->security_index); in rxrpc_describe()
565 const struct rxrpc_key_token *token; in rxrpc_read() local
587 for (token = key->payload.data[0]; token; token = token->next) { in rxrpc_read()
590 switch (token->security_index) { in rxrpc_read()
594 if (!token->no_leak_key) in rxrpc_read()
595 toksize += RND(token->kad->ticket_len); in rxrpc_read()
600 token->security_index); in rxrpc_read()
657 for (token = key->payload.data[0]; token; token = token->next) { in rxrpc_read()
661 ENCODE(token->security_index); in rxrpc_read()
663 switch (token->security_index) { in rxrpc_read()
665 ENCODE(token->kad->vice_id); in rxrpc_read()
666 ENCODE(token->kad->kvno); in rxrpc_read()
667 ENCODE_BYTES(8, token->kad->session_key); in rxrpc_read()
668 ENCODE(token->kad->start); in rxrpc_read()
669 ENCODE(token->kad->expiry); in rxrpc_read()
670 ENCODE(token->kad->primary_flag); in rxrpc_read()
671 if (token->no_leak_key) in rxrpc_read()
674 ENCODE_DATA(token->kad->ticket_len, token->kad->ticket); in rxrpc_read()
679 token->security_index); in rxrpc_read()