Lines Matching refs:ret
119 int ret = errno;
124 return (ret);
139 int ret, i;
144 ret = EINVAL;
148 ret = sscanf(&hex[i], "%02x", &c);
149 if (ret != 1) {
150 ret = EINVAL;
160 return (ret);
265 int ret = 0;
300 ret = tcsetattr(fileno(f), TCSAFLUSH, &new_term);
301 if (ret != 0) {
302 ret = errno;
309 ret = errno;
335 return (ret);
345 int ret = 0;
351 ret = EINVAL;
358 if ((ret = libzfs_getpassphrase(keyformat, B_FALSE, newkey, fsname,
369 if ((ret = validate_key(hdl, keyformat, buf, buflen)) != 0) {
371 return (ret);
374 ret = libzfs_getpassphrase(keyformat, B_TRUE, newkey, fsname, &buf2,
376 if (ret != 0) {
389 ret = EINVAL;
399 return (ret);
406 int ret = 0;
417 ret = errno;
440 ret = ENOMEM;
449 ret = errno;
457 return (ret);
466 int ret = 0;
472 ret = errno;
476 return (ret);
479 ret = get_key_material_raw(f, keyformat, buf, len_out);
483 return (ret);
497 int ret;
506 ret = zfs_prop_parse_keylocation(hdl, keylocation, &keyloc,
508 if (ret != 0)
516 ret = get_key_interactive(hdl, fsname, keyformat,
520 ret = get_key_material_raw(stdin, keyformat, &km,
524 if (ret != 0)
529 ret = ENOTSUP;
536 if ((ret = handler->zuh_handler(hdl, keylocation,
543 if (ret == ENOTSUP) {
551 ret = EINVAL;
557 if ((ret = validate_key(hdl, keyformat, (const char *)km, kmlen)) != 0)
578 return (ret);
586 int ret;
600 ret = hex_key_to_raw((char *)key_material,
602 if (ret != 0) {
611 ret = PKCS5_PBKDF2_HMAC_SHA1((char *)key_material,
614 if (ret != 1) {
615 ret = EIO;
622 ret = EINVAL;
633 return (ret);
662 int ret;
670 ret = get_key_material(hdl, B_TRUE, newkey, keyformat, keylocation,
672 if (ret != 0)
678 ret = pkcs11_get_urandom((uint8_t *)&salt, sizeof (uint64_t));
679 if (ret != sizeof (uint64_t)) {
685 ret = nvlist_add_uint64(props,
687 if (ret != 0) {
699 ret = nvlist_lookup_uint64(props,
701 if (ret == ENOENT) {
703 ret = nvlist_add_uint64(props,
705 if (ret != 0)
707 } else if (ret != 0) {
714 ret = nvlist_lookup_uint64(props,
716 if (ret == 0) {
717 ret = EINVAL;
726 ret = derive_key(hdl, keyformat, iters, key_material, key_material_len,
728 if (ret != 0)
745 return (ret);
751 int ret;
755 ret = nvlist_lookup_uint64(props,
757 if (ret == 0 && intval != ZIO_CRYPT_OFF)
760 ret = nvlist_lookup_string(props,
762 if (ret == 0 && strcmp(strval, "none") != 0)
765 ret = nvlist_lookup_uint64(props,
767 if (ret == 0)
770 ret = nvlist_lookup_uint64(props,
772 if (ret == 0)
782 int ret;
793 ret = zfs_prop_get(zhp, ZFS_PROP_ENCRYPTION_ROOT, prop_encroot,
795 if (ret != 0) {
799 return (ret);
814 int ret;
828 ret = nvlist_lookup_uint64(props,
830 if (ret != 0)
843 ret = ENOENT;
855 ret = EINVAL;
861 ret = 0;
871 ret = EINVAL;
877 ret = 0;
895 ret = EINVAL;
902 ret = 0;
914 ret = EINVAL;
925 ret = EINVAL;
934 ret = nvlist_add_string(props,
936 if (ret != 0)
950 ret = EINVAL;
956 ret = populate_create_encryption_params_nvlists(hdl, NULL,
959 if (ret != 0)
978 return (ret);
1014 int ret;
1020 ret = zfs_crypto_get_encryption_root(zhp, &is_encroot, NULL);
1021 if (ret != 0 || !is_encroot)
1031 ret = zfs_crypto_load_key(zhp, B_FALSE, NULL);
1032 if (ret)
1050 int ret;
1056 ret = ENOENT;
1060 ret = load_keys_cb(zfs_handle_dup(zhp), &cb);
1061 if (ret)
1069 ret = -1;
1079 return (ret);
1085 int ret, attempts = 0;
1103 ret = EINVAL;
1112 ret = EINVAL;
1120 ret = zfs_crypto_get_encryption_root(zhp, &is_encroot, prop_encroot);
1121 if (ret != 0) {
1130 ret = EINVAL;
1141 ret = zfs_prop_get(zhp, ZFS_PROP_KEYLOCATION, prop_keylocation,
1143 if (ret != 0) {
1159 ret = EEXIST;
1175 ret = get_key_material(zhp->zfs_hdl, B_FALSE, B_FALSE, keyformat,
1178 if (ret != 0)
1182 ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material,
1184 if (ret != 0)
1190 ret = lzc_load_key(zhp->zfs_name, noop, key_data, WRAPPING_KEY_LEN);
1191 if (ret != 0) {
1192 switch (ret) {
1247 return (ret);
1253 int ret;
1266 ret = EINVAL;
1275 ret = EINVAL;
1283 ret = zfs_crypto_get_encryption_root(zhp, &is_encroot, prop_encroot);
1284 if (ret != 0) {
1293 ret = EINVAL;
1302 ret = EACCES;
1307 ret = lzc_unload_key(zhp->zfs_name);
1309 if (ret != 0) {
1310 switch (ret) {
1328 return (ret);
1332 return (ret);
1339 int ret;
1361 ret = EINVAL;
1373 ret = EINVAL;
1383 return (ret);
1389 int ret;
1411 ret = EINVAL;
1420 ret = EINVAL;
1425 ret = zfs_crypto_get_encryption_root(zhp, &is_encroot, NULL);
1426 if (ret != 0) {
1434 ret = zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin_name,
1436 if (ret == 0 && strcmp(origin_name, "") != 0) {
1439 ret = EINVAL;
1449 ret = zfs_crypto_verify_rewrap_nvlist(zhp, raw_props, &props,
1451 if (ret != 0)
1471 ret = nvlist_add_uint64(props,
1474 if (ret != 0) {
1484 ret = zfs_prop_get(zhp, ZFS_PROP_KEYLOCATION,
1487 if (ret != 0) {
1500 ret = EINVAL;
1510 ret = nvlist_add_string(props,
1513 if (ret != 0)
1519 ret = populate_create_encryption_params_nvlists(zhp->zfs_hdl,
1522 if (ret != 0)
1530 ret = EINVAL;
1535 ret = zfs_parent_name(zhp, parent_name, sizeof (parent_name));
1536 if (ret != 0) {
1539 ret = EINVAL;
1548 ret = ENOENT;
1557 ret = EINVAL;
1566 ret = EACCES;
1576 ret = EACCES;
1581 ret = lzc_change_key(zhp->zfs_name, cmd, props, wkeydata, wkeylen);
1582 if (ret != 0) {
1583 switch (ret) {
1607 return (ret);
1618 return (ret);