forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libzfs: add keylocation=https://, backed by fetch(3) or libcurl
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Ref: openzfs#9543 Closes openzfs#9947
- Loading branch information
1 parent
b0269cd
commit 596a15f
Showing
20 changed files
with
7,159 additions
and
4,258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
dnl # | ||
dnl # Check for a libfetch - either fetch(3) or libcurl. | ||
dnl # | ||
dnl # There are two configuration dimensions: | ||
dnl # * fetch(3) vs libcurl | ||
dnl # * static vs dynamic | ||
dnl # | ||
dnl # fetch(3) is only dynamic, we use sover 6, | ||
dnl # which first appeared in 8.0-RELEASE. | ||
dnl # | ||
dnl # libcurl development packages include curl-config(1) – we want: | ||
dnl # * HTTPS support | ||
dnl # * version at least 7.10 ("October 2006"), for sover 4 | ||
dnl # * to decide if it's static or not | ||
dnl # | ||
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBFETCH], [ | ||
AC_MSG_CHECKING([for libfetch]) | ||
LIBFETCH_LIBS= | ||
LIBFETCH_IS_FETCH=0 | ||
LIBFETCH_IS_LIBCURL=0 | ||
LIBFETCH_DYNAMIC=0 | ||
LIBFETCH_SONAME= | ||
have_libfetch= | ||
saved_libs="$LIBS" | ||
LIBS="$LIBS -lfetch" | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | ||
#include <sys/param.h> | ||
#include <stdio.h> | ||
#include <fetch.h> | ||
]], [fetchGetURL("", "");])], [ | ||
have_libfetch=1 | ||
LIBFETCH_IS_FETCH=1 | ||
LIBFETCH_DYNAMIC=1 | ||
LIBFETCH_SONAME='"libfetch.so.6"' | ||
LIBFETCH_LIBS="-ldl" | ||
AC_MSG_RESULT([fetch(3)]) | ||
], []) | ||
LIBS="$saved_libs" | ||
if test -z "$have_libfetch"; then | ||
if curl-config --protocols 2>/dev/null | grep -q HTTPS && | ||
test "$(("0x$(curl-config --vernum)"))" -ge "$((0x071000))"; then | ||
have_libfetch=1 | ||
LIBFETCH_IS_LIBCURL=1 | ||
if test "$(curl-config --built-shared)" = "yes"; then | ||
LIBFETCH_DYNAMIC=1 | ||
LIBFETCH_SONAME='"libcurl.so.4"' | ||
LIBFETCH_LIBS="-ldl" | ||
AC_MSG_RESULT([libcurl]) | ||
else | ||
LIBFETCH_LIBS="$(curl-config --libs)" | ||
AC_MSG_RESULT([libcurl (static)]) | ||
fi | ||
CCFLAGS="$CCFLAGS $(curl-config --cflags)" | ||
fi | ||
fi | ||
if test -z "$have_libfetch"; then | ||
AC_MSG_RESULT([none]) | ||
fi | ||
AC_SUBST([LIBFETCH_LIBS]) | ||
AC_DEFINE_UNQUOTED([LIBFETCH_IS_FETCH], [$LIBFETCH_IS_FETCH], [libfetch is fetch(3)]) | ||
AC_DEFINE_UNQUOTED([LIBFETCH_IS_LIBCURL], [$LIBFETCH_IS_LIBCURL], [libfetch is libcurl]) | ||
AC_DEFINE_UNQUOTED([LIBFETCH_DYNAMIC], [$LIBFETCH_DYNAMIC], [whether the chosen libfetch is to be loaded at run-time]) | ||
AC_DEFINE_UNQUOTED([LIBFETCH_SONAME], [$LIBFETCH_SONAME], [soname of chosen libfetch]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/zfs-tests/tests/functional/cli_root/zfs_load-key/PASSPHRASE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.