mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
libzfs: add keylocation=https://, backed by fetch(3) or libcurl
Add support for http and https to the keylocation properly to allow encryption keys to be fetched from the specified URL. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Issue #9543 Closes #9947 Closes #11956
This commit is contained in:
@@ -583,7 +583,7 @@ zfs_prop_init(void)
|
||||
"ENCROOT");
|
||||
zprop_register_string(ZFS_PROP_KEYLOCATION, "keylocation",
|
||||
"none", PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
||||
"prompt | <file URI>", "KEYLOCATION");
|
||||
"prompt | <file URI> | <https URL> | <http URL>", "KEYLOCATION");
|
||||
zprop_register_string(ZFS_PROP_REDACT_SNAPS,
|
||||
"redact_snaps", NULL, PROP_READONLY,
|
||||
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<snapshot>[,...]",
|
||||
@@ -936,6 +936,10 @@ zfs_prop_valid_keylocation(const char *str, boolean_t encrypted)
|
||||
return (B_TRUE);
|
||||
else if (strlen(str) > 8 && strncmp("file:///", str, 8) == 0)
|
||||
return (B_TRUE);
|
||||
else if (strlen(str) > 8 && strncmp("https://", str, 8) == 0)
|
||||
return (B_TRUE);
|
||||
else if (strlen(str) > 7 && strncmp("http://", str, 7) == 0)
|
||||
return (B_TRUE);
|
||||
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user