Lines Matching refs:server

43 smb2_crypto_shash_allocate(struct TCP_Server_Info *server)  in smb2_crypto_shash_allocate()  argument
48 if (server->secmech.sdeschmacsha256 != NULL) in smb2_crypto_shash_allocate()
51 server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0); in smb2_crypto_shash_allocate()
52 if (IS_ERR(server->secmech.hmacsha256)) { in smb2_crypto_shash_allocate()
54 rc = PTR_ERR(server->secmech.hmacsha256); in smb2_crypto_shash_allocate()
55 server->secmech.hmacsha256 = NULL; in smb2_crypto_shash_allocate()
60 crypto_shash_descsize(server->secmech.hmacsha256); in smb2_crypto_shash_allocate()
61 server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL); in smb2_crypto_shash_allocate()
62 if (!server->secmech.sdeschmacsha256) { in smb2_crypto_shash_allocate()
63 crypto_free_shash(server->secmech.hmacsha256); in smb2_crypto_shash_allocate()
64 server->secmech.hmacsha256 = NULL; in smb2_crypto_shash_allocate()
67 server->secmech.sdeschmacsha256->shash.tfm = server->secmech.hmacsha256; in smb2_crypto_shash_allocate()
68 server->secmech.sdeschmacsha256->shash.flags = 0x0; in smb2_crypto_shash_allocate()
74 smb3_crypto_shash_allocate(struct TCP_Server_Info *server) in smb3_crypto_shash_allocate() argument
79 if (server->secmech.sdesccmacaes != NULL) in smb3_crypto_shash_allocate()
82 rc = smb2_crypto_shash_allocate(server); in smb3_crypto_shash_allocate()
86 server->secmech.cmacaes = crypto_alloc_shash("cmac(aes)", 0, 0); in smb3_crypto_shash_allocate()
87 if (IS_ERR(server->secmech.cmacaes)) { in smb3_crypto_shash_allocate()
89 kfree(server->secmech.sdeschmacsha256); in smb3_crypto_shash_allocate()
90 server->secmech.sdeschmacsha256 = NULL; in smb3_crypto_shash_allocate()
91 crypto_free_shash(server->secmech.hmacsha256); in smb3_crypto_shash_allocate()
92 server->secmech.hmacsha256 = NULL; in smb3_crypto_shash_allocate()
93 rc = PTR_ERR(server->secmech.cmacaes); in smb3_crypto_shash_allocate()
94 server->secmech.cmacaes = NULL; in smb3_crypto_shash_allocate()
99 crypto_shash_descsize(server->secmech.cmacaes); in smb3_crypto_shash_allocate()
100 server->secmech.sdesccmacaes = kmalloc(size, GFP_KERNEL); in smb3_crypto_shash_allocate()
101 if (!server->secmech.sdesccmacaes) { in smb3_crypto_shash_allocate()
103 kfree(server->secmech.sdeschmacsha256); in smb3_crypto_shash_allocate()
104 server->secmech.sdeschmacsha256 = NULL; in smb3_crypto_shash_allocate()
105 crypto_free_shash(server->secmech.hmacsha256); in smb3_crypto_shash_allocate()
106 crypto_free_shash(server->secmech.cmacaes); in smb3_crypto_shash_allocate()
107 server->secmech.hmacsha256 = NULL; in smb3_crypto_shash_allocate()
108 server->secmech.cmacaes = NULL; in smb3_crypto_shash_allocate()
111 server->secmech.sdesccmacaes->shash.tfm = server->secmech.cmacaes; in smb3_crypto_shash_allocate()
112 server->secmech.sdesccmacaes->shash.flags = 0x0; in smb3_crypto_shash_allocate()
118 smb2_find_smb_ses(struct smb2_hdr *smb2hdr, struct TCP_Server_Info *server) in smb2_find_smb_ses() argument
123 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in smb2_find_smb_ses()
136 smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) in smb2_calc_signature() argument
146 ses = smb2_find_smb_ses(smb2_pdu, server); in smb2_calc_signature()
155 rc = smb2_crypto_shash_allocate(server); in smb2_calc_signature()
161 rc = crypto_shash_setkey(server->secmech.hmacsha256, in smb2_calc_signature()
168 rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash); in smb2_calc_signature()
190 &server->secmech.sdeschmacsha256->shash, in smb2_calc_signature()
195 &server->secmech.sdeschmacsha256->shash, in smb2_calc_signature()
210 crypto_shash_update(&server->secmech.sdeschmacsha256->shash, in smb2_calc_signature()
215 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash, in smb2_calc_signature()
238 rc = smb3_crypto_shash_allocate(ses->server); in generate_smb3signingkey()
244 rc = crypto_shash_setkey(ses->server->secmech.hmacsha256, in generate_smb3signingkey()
251 rc = crypto_shash_init(&ses->server->secmech.sdeschmacsha256->shash); in generate_smb3signingkey()
257 rc = crypto_shash_update(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
264 rc = crypto_shash_update(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
271 rc = crypto_shash_update(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
278 rc = crypto_shash_update(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
285 rc = crypto_shash_update(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
292 rc = crypto_shash_final(&ses->server->secmech.sdeschmacsha256->shash, in generate_smb3signingkey()
306 smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) in smb3_calc_signature() argument
317 ses = smb2_find_smb_ses(smb2_pdu, server); in smb3_calc_signature()
326 rc = crypto_shash_setkey(server->secmech.cmacaes, in smb3_calc_signature()
339 rc = crypto_shash_init(&server->secmech.sdesccmacaes->shash); in smb3_calc_signature()
361 &server->secmech.sdesccmacaes->shash, in smb3_calc_signature()
366 &server->secmech.sdesccmacaes->shash, in smb3_calc_signature()
381 crypto_shash_update(&server->secmech.sdesccmacaes->shash, in smb3_calc_signature()
386 rc = crypto_shash_final(&server->secmech.sdesccmacaes->shash, in smb3_calc_signature()
398 smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server) in smb2_sign_rqst() argument
404 server->tcpStatus == CifsNeedNegotiate) in smb2_sign_rqst()
407 if (!server->session_estab) { in smb2_sign_rqst()
412 rc = server->ops->calc_signature(rqst, server); in smb2_sign_rqst()
418 smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) in smb2_verify_signature() argument
427 (!server->session_estab)) in smb2_verify_signature()
448 mutex_lock(&server->srv_mutex); in smb2_verify_signature()
449 rc = server->ops->calc_signature(rqst, server); in smb2_verify_signature()
450 mutex_unlock(&server->srv_mutex); in smb2_verify_signature()
467 smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr) in smb2_seq_num_into_buf() argument
471 hdr->MessageId = get_next_mid64(server); in smb2_seq_num_into_buf()
474 get_next_mid(server); in smb2_seq_num_into_buf()
479 struct TCP_Server_Info *server) in smb2_mid_entry_alloc() argument
483 if (server == NULL) { in smb2_mid_entry_alloc()
497 temp->server = server; in smb2_mid_entry_alloc()
516 if (ses->server->tcpStatus == CifsExiting) in smb2_get_mid_entry()
519 if (ses->server->tcpStatus == CifsNeedReconnect) { in smb2_get_mid_entry()
537 *mid = smb2_mid_entry_alloc(buf, ses->server); in smb2_get_mid_entry()
541 list_add_tail(&(*mid)->qhead, &ses->server->pending_mid_q); in smb2_get_mid_entry()
547 smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, in smb2_check_receive() argument
560 if (len > 24 && server->sign) { in smb2_check_receive()
563 rc = smb2_verify_signature(&rqst, server); in smb2_check_receive()
579 smb2_seq_num_into_buf(ses->server, hdr); in smb2_setup_request()
584 rc = smb2_sign_rqst(rqst, ses->server); in smb2_setup_request()
593 smb2_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst) in smb2_setup_async_request() argument
599 smb2_seq_num_into_buf(server, hdr); in smb2_setup_async_request()
601 mid = smb2_mid_entry_alloc(hdr, server); in smb2_setup_async_request()
605 rc = smb2_sign_rqst(rqst, server); in smb2_setup_async_request()