• Home
  • Raw
  • Download

Lines Matching refs:rc

83 	int rc;  in ksmbd_gen_sess_key()  local
91 rc = crypto_shash_setkey(CRYPTO_HMACMD5_TFM(ctx), in ksmbd_gen_sess_key()
94 if (rc) { in ksmbd_gen_sess_key()
95 ksmbd_debug(AUTH, "hmacmd5 set key fail error %d\n", rc); in ksmbd_gen_sess_key()
99 rc = crypto_shash_init(CRYPTO_HMACMD5(ctx)); in ksmbd_gen_sess_key()
100 if (rc) { in ksmbd_gen_sess_key()
101 ksmbd_debug(AUTH, "could not init hmacmd5 error %d\n", rc); in ksmbd_gen_sess_key()
105 rc = crypto_shash_update(CRYPTO_HMACMD5(ctx), in ksmbd_gen_sess_key()
108 if (rc) { in ksmbd_gen_sess_key()
109 ksmbd_debug(AUTH, "Could not update with response error %d\n", rc); in ksmbd_gen_sess_key()
113 rc = crypto_shash_final(CRYPTO_HMACMD5(ctx), sess->sess_key); in ksmbd_gen_sess_key()
114 if (rc) { in ksmbd_gen_sess_key()
115 ksmbd_debug(AUTH, "Could not generate hmacmd5 hash error %d\n", rc); in ksmbd_gen_sess_key()
121 return rc; in ksmbd_gen_sess_key()
226 int rc, len; in ksmbd_auth_ntlmv2() local
228 rc = calc_ntlmv2_hash(conn, sess, ntlmv2_hash, domain_name); in ksmbd_auth_ntlmv2()
229 if (rc) { in ksmbd_auth_ntlmv2()
230 ksmbd_debug(AUTH, "could not get v2 hash rc %d\n", rc); in ksmbd_auth_ntlmv2()
240 rc = crypto_shash_setkey(CRYPTO_HMACMD5_TFM(ctx), in ksmbd_auth_ntlmv2()
243 if (rc) { in ksmbd_auth_ntlmv2()
248 rc = crypto_shash_init(CRYPTO_HMACMD5(ctx)); in ksmbd_auth_ntlmv2()
249 if (rc) { in ksmbd_auth_ntlmv2()
257 rc = -ENOMEM; in ksmbd_auth_ntlmv2()
264 rc = crypto_shash_update(CRYPTO_HMACMD5(ctx), construct, len); in ksmbd_auth_ntlmv2()
265 if (rc) { in ksmbd_auth_ntlmv2()
270 rc = crypto_shash_final(CRYPTO_HMACMD5(ctx), ntlmv2_rsp); in ksmbd_auth_ntlmv2()
271 if (rc) { in ksmbd_auth_ntlmv2()
278 rc = ksmbd_gen_sess_key(sess, ntlmv2_hash, ntlmv2_rsp); in ksmbd_auth_ntlmv2()
279 if (rc) { in ksmbd_auth_ntlmv2()
285 rc = -EINVAL; in ksmbd_auth_ntlmv2()
290 return rc; in ksmbd_auth_ntlmv2()
579 int rc, i; in ksmbd_sign_smb2_pdu() local
587 rc = crypto_shash_setkey(CRYPTO_HMACSHA256_TFM(ctx), in ksmbd_sign_smb2_pdu()
590 if (rc) in ksmbd_sign_smb2_pdu()
593 rc = crypto_shash_init(CRYPTO_HMACSHA256(ctx)); in ksmbd_sign_smb2_pdu()
594 if (rc) { in ksmbd_sign_smb2_pdu()
595 ksmbd_debug(AUTH, "hmacsha256 init error %d\n", rc); in ksmbd_sign_smb2_pdu()
600 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), in ksmbd_sign_smb2_pdu()
603 if (rc) { in ksmbd_sign_smb2_pdu()
604 ksmbd_debug(AUTH, "hmacsha256 update error %d\n", rc); in ksmbd_sign_smb2_pdu()
609 rc = crypto_shash_final(CRYPTO_HMACSHA256(ctx), sig); in ksmbd_sign_smb2_pdu()
610 if (rc) in ksmbd_sign_smb2_pdu()
611 ksmbd_debug(AUTH, "hmacsha256 generation error %d\n", rc); in ksmbd_sign_smb2_pdu()
614 return rc; in ksmbd_sign_smb2_pdu()
630 int rc, i; in ksmbd_sign_smb3_pdu() local
638 rc = crypto_shash_setkey(CRYPTO_CMACAES_TFM(ctx), in ksmbd_sign_smb3_pdu()
641 if (rc) in ksmbd_sign_smb3_pdu()
644 rc = crypto_shash_init(CRYPTO_CMACAES(ctx)); in ksmbd_sign_smb3_pdu()
645 if (rc) { in ksmbd_sign_smb3_pdu()
646 ksmbd_debug(AUTH, "cmaces init error %d\n", rc); in ksmbd_sign_smb3_pdu()
651 rc = crypto_shash_update(CRYPTO_CMACAES(ctx), in ksmbd_sign_smb3_pdu()
654 if (rc) { in ksmbd_sign_smb3_pdu()
655 ksmbd_debug(AUTH, "cmaces update error %d\n", rc); in ksmbd_sign_smb3_pdu()
660 rc = crypto_shash_final(CRYPTO_CMACAES(ctx), sig); in ksmbd_sign_smb3_pdu()
661 if (rc) in ksmbd_sign_smb3_pdu()
662 ksmbd_debug(AUTH, "cmaces generation error %d\n", rc); in ksmbd_sign_smb3_pdu()
665 return rc; in ksmbd_sign_smb3_pdu()
682 int rc; in generate_key() local
696 rc = crypto_shash_setkey(CRYPTO_HMACSHA256_TFM(ctx), in generate_key()
699 if (rc) in generate_key()
702 rc = crypto_shash_init(CRYPTO_HMACSHA256(ctx)); in generate_key()
703 if (rc) { in generate_key()
704 ksmbd_debug(AUTH, "hmacsha256 init error %d\n", rc); in generate_key()
708 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), i, 4); in generate_key()
709 if (rc) { in generate_key()
714 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), in generate_key()
717 if (rc) { in generate_key()
722 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), &zero, 1); in generate_key()
723 if (rc) { in generate_key()
728 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), in generate_key()
731 if (rc) { in generate_key()
739 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), L256, 4); in generate_key()
741 rc = crypto_shash_update(CRYPTO_HMACSHA256(ctx), L128, 4); in generate_key()
742 if (rc) { in generate_key()
747 rc = crypto_shash_final(CRYPTO_HMACSHA256(ctx), hashptr); in generate_key()
748 if (rc) { in generate_key()
750 rc); in generate_key()
758 return rc; in generate_key()
765 int rc; in generate_smb3signingkey() local
778 rc = generate_key(conn, sess, signing->label, signing->context, key, in generate_smb3signingkey()
780 if (rc) in generate_smb3signingkey()
781 return rc; in generate_smb3signingkey()
841 int rc; in generate_smb3encryptionkey() local
843 rc = generate_key(conn, sess, ptwin->encryption.label, in generate_smb3encryptionkey()
846 if (rc) in generate_smb3encryptionkey()
847 return rc; in generate_smb3encryptionkey()
849 rc = generate_key(conn, sess, ptwin->decryption.label, in generate_smb3encryptionkey()
852 if (rc) in generate_smb3encryptionkey()
853 return rc; in generate_smb3encryptionkey()
920 int rc; in ksmbd_gen_preauth_integrity_hash() local
936 rc = crypto_shash_init(CRYPTO_SHA512(ctx)); in ksmbd_gen_preauth_integrity_hash()
937 if (rc) { in ksmbd_gen_preauth_integrity_hash()
942 rc = crypto_shash_update(CRYPTO_SHA512(ctx), pi_hash, 64); in ksmbd_gen_preauth_integrity_hash()
943 if (rc) { in ksmbd_gen_preauth_integrity_hash()
948 rc = crypto_shash_update(CRYPTO_SHA512(ctx), all_bytes_msg, msg_size); in ksmbd_gen_preauth_integrity_hash()
949 if (rc) { in ksmbd_gen_preauth_integrity_hash()
954 rc = crypto_shash_final(CRYPTO_SHA512(ctx), pi_hash); in ksmbd_gen_preauth_integrity_hash()
955 if (rc) { in ksmbd_gen_preauth_integrity_hash()
956 ksmbd_debug(AUTH, "Could not generate hash err : %d\n", rc); in ksmbd_gen_preauth_integrity_hash()
961 return rc; in ksmbd_gen_preauth_integrity_hash()
967 int rc; in ksmbd_gen_sd_hash() local
976 rc = crypto_shash_init(CRYPTO_SHA256(ctx)); in ksmbd_gen_sd_hash()
977 if (rc) { in ksmbd_gen_sd_hash()
982 rc = crypto_shash_update(CRYPTO_SHA256(ctx), sd_buf, len); in ksmbd_gen_sd_hash()
983 if (rc) { in ksmbd_gen_sd_hash()
988 rc = crypto_shash_final(CRYPTO_SHA256(ctx), pi_hash); in ksmbd_gen_sd_hash()
989 if (rc) { in ksmbd_gen_sd_hash()
990 ksmbd_debug(AUTH, "Could not generate hash err : %d\n", rc); in ksmbd_gen_sd_hash()
995 return rc; in ksmbd_gen_sd_hash()
1108 int rc; in ksmbd_crypt_message() local
1119 rc = ksmbd_get_encryption_key(work, in ksmbd_crypt_message()
1123 if (rc) { in ksmbd_crypt_message()
1125 return rc; in ksmbd_crypt_message()
1146 rc = crypto_aead_setkey(tfm, key, SMB3_GCM256_CRYPTKEY_SIZE); in ksmbd_crypt_message()
1148 rc = crypto_aead_setkey(tfm, key, SMB3_GCM128_CRYPTKEY_SIZE); in ksmbd_crypt_message()
1149 if (rc) { in ksmbd_crypt_message()
1150 pr_err("Failed to set aead key %d\n", rc); in ksmbd_crypt_message()
1154 rc = crypto_aead_setauthsize(tfm, SMB2_SIGNATURE_SIZE); in ksmbd_crypt_message()
1155 if (rc) { in ksmbd_crypt_message()
1156 pr_err("Failed to set authsize %d\n", rc); in ksmbd_crypt_message()
1162 rc = -ENOMEM; in ksmbd_crypt_message()
1174 rc = -ENOMEM; in ksmbd_crypt_message()
1181 rc = -ENOMEM; in ksmbd_crypt_message()
1198 rc = crypto_aead_encrypt(req); in ksmbd_crypt_message()
1200 rc = crypto_aead_decrypt(req); in ksmbd_crypt_message()
1201 if (rc) in ksmbd_crypt_message()
1215 return rc; in ksmbd_crypt_message()