Lines Matching refs:iname
98 int fscrypt_fname_encrypt(const struct inode *inode, const struct qstr *iname, in fscrypt_fname_encrypt() argument
113 if (WARN_ON(olen < iname->len)) in fscrypt_fname_encrypt()
115 memcpy(out, iname->name, iname->len); in fscrypt_fname_encrypt()
116 memset(out + iname->len, 0, olen - iname->len); in fscrypt_fname_encrypt()
154 const struct fscrypt_str *iname, in fname_decrypt() argument
177 sg_init_one(&src_sg, iname->name, iname->len); in fname_decrypt()
179 skcipher_request_set_crypt(req, &src_sg, &dst_sg, iname->len, &iv); in fname_decrypt()
187 oname->len = strnlen(oname->name, iname->len); in fname_decrypt()
371 const struct fscrypt_str *iname, in fscrypt_fname_disk_to_usr() argument
374 const struct qstr qname = FSTR_TO_QSTR(iname); in fscrypt_fname_disk_to_usr()
380 oname->name[iname->len - 1] = '.'; in fscrypt_fname_disk_to_usr()
381 oname->len = iname->len; in fscrypt_fname_disk_to_usr()
385 if (iname->len < FSCRYPT_FNAME_MIN_MSG_LEN) in fscrypt_fname_disk_to_usr()
389 return fname_decrypt(inode, iname, oname); in fscrypt_fname_disk_to_usr()
404 if (iname->len <= sizeof(nokey_name.bytes)) { in fscrypt_fname_disk_to_usr()
405 memcpy(nokey_name.bytes, iname->name, iname->len); in fscrypt_fname_disk_to_usr()
406 size = offsetof(struct fscrypt_nokey_name, bytes[iname->len]); in fscrypt_fname_disk_to_usr()
408 memcpy(nokey_name.bytes, iname->name, sizeof(nokey_name.bytes)); in fscrypt_fname_disk_to_usr()
410 sha256(&iname->name[sizeof(nokey_name.bytes)], in fscrypt_fname_disk_to_usr()
411 iname->len - sizeof(nokey_name.bytes), in fscrypt_fname_disk_to_usr()
444 int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname, in fscrypt_setup_filename() argument
451 fname->usr_fname = iname; in fscrypt_setup_filename()
453 if (!IS_ENCRYPTED(dir) || fscrypt_is_dot_dotdot(iname)) { in fscrypt_setup_filename()
454 fname->disk_name.name = (unsigned char *)iname->name; in fscrypt_setup_filename()
455 fname->disk_name.len = iname->len; in fscrypt_setup_filename()
463 if (!fscrypt_fname_encrypted_size(dir, iname->len, NAME_MAX, in fscrypt_setup_filename()
471 ret = fscrypt_fname_encrypt(dir, iname, fname->crypto_buf.name, in fscrypt_setup_filename()
488 if (iname->len > FSCRYPT_NOKEY_NAME_MAX_ENCODED) in fscrypt_setup_filename()
495 ret = fscrypt_base64url_decode(iname->name, iname->len, in fscrypt_setup_filename()