Lines Matching defs:call
147 * Allocate and prepare the crypto request on a call. For any particular call,
150 static struct skcipher_request *rxkad_get_call_crypto(struct rxrpc_call *call)
152 struct crypto_skcipher *tfm = &call->conn->cipher->base;
153 struct skcipher_request *cipher_req = call->cipher_req;
159 call->cipher_req = cipher_req;
166 * Clean up the crypto on a call.
168 static void rxkad_free_call_crypto(struct rxrpc_call *call)
170 if (call->cipher_req)
171 skcipher_request_free(call->cipher_req);
172 call->cipher_req = NULL;
178 static int rxkad_secure_packet_auth(const struct rxrpc_call *call,
192 check = sp->hdr.seq ^ call->call_id;
202 skcipher_request_set_sync_tfm(req, call->conn->cipher);
215 static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
234 check = sp->hdr.seq ^ call->call_id;
241 token = call->conn->params.key->payload.data[0];
245 skcipher_request_set_sync_tfm(req, call->conn->cipher);
255 len = data_size + call->conn->size_align - 1;
256 len &= ~(call->conn->size_align - 1);
276 static int rxkad_secure_packet(struct rxrpc_call *call,
291 call->debug_id, key_serial(call->conn->params.key),
294 if (!call->conn->cipher)
297 ret = key_validate(call->conn->params.key);
301 req = rxkad_get_call_crypto(call);
306 memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
309 x = (call->cid & RXRPC_CHANNELMASK) << (32 - RXRPC_CIDSHIFT);
311 call->crypto_buf[0] = htonl(call->call_id);
312 call->crypto_buf[1] = htonl(x);
314 sg_init_one(&sg, call->crypto_buf, 8);
315 skcipher_request_set_sync_tfm(req, call->conn->cipher);
321 y = ntohl(call->crypto_buf[1]);
327 switch (call->conn->params.security_level) {
332 ret = rxkad_secure_packet_auth(call, skb, data_size, sechdr,
336 ret = rxkad_secure_packet_encrypt(call, skb, data_size,
351 static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb,
367 aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_hdr", "V1H",
383 skcipher_request_set_sync_tfm(req, call->conn->cipher);
391 aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_len", "XV1",
402 check ^= seq ^ call->call_id;
405 aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_check", "V1C",
411 aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_datalen", "V1L",
421 rxrpc_send_abort_packet(call);
428 static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb,
445 aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_hdr", "V2H",
472 token = call->conn->params.key->payload.data[0];
475 skcipher_request_set_sync_tfm(req, call->conn->cipher);
485 aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_len", "XV2",
496 check ^= seq ^ call->call_id;
499 aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_check", "V2C",
505 aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_datalen", "V2L",
515 rxrpc_send_abort_packet(call);
527 static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb,
539 call->debug_id, key_serial(call->conn->params.key), seq);
541 if (!call->conn->cipher)
544 req = rxkad_get_call_crypto(call);
549 memcpy(&iv, call->conn->csum_iv.x, sizeof(iv));
552 x = (call->cid & RXRPC_CHANNELMASK) << (32 - RXRPC_CIDSHIFT);
554 call->crypto_buf[0] = htonl(call->call_id);
555 call->crypto_buf[1] = htonl(x);
557 sg_init_one(&sg, call->crypto_buf, 8);
558 skcipher_request_set_sync_tfm(req, call->conn->cipher);
564 y = ntohl(call->crypto_buf[1]);
570 aborted = rxrpc_abort_eproto(call, skb, "rxkad_csum", "VCK",
575 switch (call->conn->params.security_level) {
579 return rxkad_verify_packet_1(call, skb, offset, len, seq, req);
581 return rxkad_verify_packet_2(call, skb, offset, len, seq, req);
588 rxrpc_send_abort_packet(call);
595 static void rxkad_locate_data_1(struct rxrpc_call *call, struct sk_buff *skb,
609 static void rxkad_locate_data_2(struct rxrpc_call *call, struct sk_buff *skb,
623 static void rxkad_locate_data(struct rxrpc_call *call, struct sk_buff *skb,
626 switch (call->conn->params.security_level) {
628 rxkad_locate_data_1(call, skb, _offset, _len);
631 rxkad_locate_data_2(call, skb, _offset, _len);
1174 struct rxrpc_call *call;
1187 call = rcu_dereference_protected(
1188 conn->channels[i].call,
1190 if (call && call->state < RXRPC_CALL_COMPLETE)