<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/b005e6d62b4ad399217a943641dabe83abcc7800">https://github.com/macports/macports-base/commit/b005e6d62b4ad399217a943641dabe83abcc7800</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b005e6d62b4ad399217a943641dabe83abcc7800
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed Jul 3 00:17:38 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> signify: restore compatibility functions
</span>---
configure | 327 +++++++++-------
configure.ac | 22 +-
src/config.h.in | 16 +
vendor/signify-osx/.gitignore | 1 +
vendor/signify-osx/Makefile | 34 ++
vendor/signify-osx/autoconf.mk.in | 4 +
vendor/signify-osx/missing.h | 12 +
vendor/signify-osx/src/include/readpassphrase.h | 40 ++
vendor/signify-osx/src/lib/libc/crypt/arc4random.c | 204 ++++++++++
vendor/signify-osx/src/lib/libc/crypt/arc4random.h | 1 +
.../src/lib/libc/crypt/chacha_private.h | 222 +++++++++++
.../signify-osx/src/lib/libc/gen/readpassphrase.c | 192 ++++++++++
.../src/lib/libc/string/timingsafe_bcmp.c | 30 ++
.../src/lib/libcrypto/arc4random/arc4random_osx.h | 81 ++++
.../src/lib/libcrypto/arc4random/getentropy_osx.c | 417 +++++++++++++++++++++
15 files changed, 1459 insertions(+), 144 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/configure b/configure
</span><span style='display:block; white-space:pre;color:#808080;'>index f5dbc2f26..d2036bc41 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/configure
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/configure
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -689,6 +689,10 @@ HAVE_STRLCPY
</span> HAVE_STRLCAT
HAVE_GETLINE
HAVE_GETDELIM
<span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_TIMINGSAFE_BCMP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_GETENTROPY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_ARC4RANDOM_BUF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_DECL_RPP_STDIN
</span> UNIVERSAL_ARCHFLAGS
UNIVERSAL_ARCHS
startupitem_install
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1757,6 +1761,60 @@ printf "%s\n" "$ac_res" >&6; }
</span>
} # ac_fn_c_check_header_compile
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# ------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_check_decl ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as_decl_name=`echo $2|sed 's/ *(.*//'`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf %s "checking whether $as_decl_name is declared... " >&6; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if eval test \${$3+y}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf %s "(cached) " >&6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eval ac_save_FLAGS=\$$6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as_fn_append $6 " $5"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+$4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+main (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef $as_decl_name
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef __cplusplus
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void) $as_decl_use;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void) $as_decl_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_ACEOF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eval "$3=yes"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) eval "$3=no" ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eval $6=\$ac_save_FLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+eval ac_res=\$$3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf "%s\n" "$ac_res" >&6; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} # ac_fn_check_decl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1821,60 +1879,6 @@ printf "%s\n" "$ac_res" >&6; }
</span>
} # ac_fn_c_check_func
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# ------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-ac_fn_check_decl ()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- as_decl_name=`echo $2|sed 's/ *(.*//'`
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-printf %s "checking whether $as_decl_name is declared... " >&6; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if eval test \${$3+y}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- printf %s "(cached) " >&6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else case e in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eval ac_save_FLAGS=\$$6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- as_fn_append $6 " $5"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-$4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-main (void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#ifndef $as_decl_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#ifdef __cplusplus
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (void) $as_decl_use;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (void) $as_decl_name;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-_ACEOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eval "$3=yes"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else case e in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- e) eval "$3=no" ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eval $6=\$ac_save_FLAGS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-eval ac_res=\$$3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-printf "%s\n" "$ac_res" >&6; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} # ac_fn_check_decl
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7422,6 +7426,12 @@ if test "x$ac_cv_header_pwd_h" = xyes
</span> then :
printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h
<span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_c_check_header_compile "$LINENO" "readpassphrase.h" "ac_cv_header_readpassphrase_h" "$ac_includes_default"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test "x$ac_cv_header_readpassphrase_h" = xyes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "%s\n" "#define HAVE_READPASSPHRASE_H 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> fi
ac_fn_c_check_header_compile "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
if test "x$ac_cv_header_readline_history_h" = xyes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7509,6 +7519,103 @@ then :
</span> fi
<span style='display:block; white-space:pre;background:#e0ffe0;'>+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test ${ac_cv_c_undeclared_builtin_options+y}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf %s "(cached) " >&6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) ac_save_CFLAGS=$CFLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_cv_c_undeclared_builtin_options='cannot detect'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ac_arg in '' -fno-builtin; do
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CFLAGS="$ac_save_CFLAGS $ac_arg"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # This test program should *not* compile successfully.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+main (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(void) strchr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_ACEOF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) # This test program should compile successfully.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # No library function is consistently available on
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # freestanding implementations, so test against a dummy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # declaration. Include always-available headers on the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # off chance that they somehow elicit warnings.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <float.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <limits.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdarg.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stddef.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern void ac_decl (int, char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+main (void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(void) ac_decl (0, (char *) 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void) ac_decl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_ACEOF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if test x"$ac_arg" = x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_cv_c_undeclared_builtin_options='none needed'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) ac_cv_c_undeclared_builtin_options=$ac_arg ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ done
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CFLAGS=$ac_save_CFLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case $ac_cv_c_undeclared_builtin_options in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'cannot detect') :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+as_fn_error $? "cannot make $CC report undeclared builtins
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+See 'config.log' for more details" "$LINENO" 5; } ;; #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'none needed') :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_c_undeclared_builtin_options='' ;; #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_check_decl "$LINENO" "RPP_STDIN" "ac_cv_have_decl_RPP_STDIN" "#include <readpassphrase.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+" "$ac_c_undeclared_builtin_options" "CFLAGS"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test "x$ac_cv_have_decl_RPP_STDIN" = xyes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_have_decl=1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else case e in #(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e) ac_have_decl=0 ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+printf "%s\n" "#define HAVE_DECL_RPP_STDIN $ac_have_decl" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_DECL_RPP_STDIN=$ac_cv_have_decl_RPP_STDIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Checks for library functions.
ac_fn_c_check_func "$LINENO" "OSAtomicCompareAndSwap32" "ac_cv_func_OSAtomicCompareAndSwap32"
if test "x$ac_cv_func_OSAtomicCompareAndSwap32" = xyes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7533,6 +7640,12 @@ if test "x$ac_cv_func___getdirentries64" = xyes
</span> then :
printf "%s\n" "#define HAVE___GETDIRENTRIES64 1" >>confdefs.h
<span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test "x$ac_cv_func_arc4random_buf" = xyes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> fi
ac_fn_c_check_func "$LINENO" "clearenv" "ac_cv_func_clearenv"
if test "x$ac_cv_func_clearenv" = xyes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7569,6 +7682,12 @@ if test "x$ac_cv_func_fls" = xyes
</span> then :
printf "%s\n" "#define HAVE_FLS 1" >>confdefs.h
<span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test "x$ac_cv_func_getentropy" = xyes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "%s\n" "#define HAVE_GETENTROPY 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> fi
ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue"
if test "x$ac_cv_func_kqueue" = xyes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7594,6 +7713,20 @@ then :
</span> printf "%s\n" "#define HAVE_SYSCTLBYNAME 1" >>confdefs.h
fi
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_fn_c_check_func "$LINENO" "timingsafe_bcmp" "ac_cv_func_timingsafe_bcmp"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if test "x$ac_cv_func_timingsafe_bcmp" = xyes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "%s\n" "#define HAVE_TIMINGSAFE_BCMP 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# For vendor/signify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_ARC4RANDOM_BUF=$ac_cv_func_arc4random_buf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_GETENTROPY=$ac_cv_func_getentropy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_TIMINGSAFE_BCMP=$ac_cv_func_timingsafe_bcmp
</span>
# Check for library functions, replacements are in pextlib1.0/compat/
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7631,89 +7764,6 @@ HAVE_STRLCAT=$ac_cv_func_strlcat
</span> HAVE_STRLCPY=$ac_cv_func_strlcpy
<span style='display:block; white-space:pre;background:#ffe0e0;'>-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if test ${ac_cv_c_undeclared_builtin_options+y}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- printf %s "(cached) " >&6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else case e in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- e) ac_save_CFLAGS=$CFLAGS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ac_cv_c_undeclared_builtin_options='cannot detect'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for ac_arg in '' -fno-builtin; do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS="$ac_save_CFLAGS $ac_arg"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This test program should *not* compile successfully.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-main (void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-(void) strchr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-_ACEOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else case e in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- e) # This test program should compile successfully.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # No library function is consistently available on
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # freestanding implementations, so test against a dummy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # declaration. Include always-available headers on the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # off chance that they somehow elicit warnings.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-/* end confdefs.h. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#include <float.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#include <limits.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#include <stdarg.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#include <stddef.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-extern void ac_decl (int, char *);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-main (void)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-(void) ac_decl (0, (char *) 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (void) ac_decl;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-_ACEOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if ac_fn_c_try_compile "$LINENO"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test x"$ac_arg" = x
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-then :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ac_cv_c_undeclared_builtin_options='none needed'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-else case e in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- e) ac_cv_c_undeclared_builtin_options=$ac_arg ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- done
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS=$ac_save_CFLAGS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- case $ac_cv_c_undeclared_builtin_options in #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'cannot detect') :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-as_fn_error $? "cannot make $CC report undeclared builtins
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-See 'config.log' for more details" "$LINENO" 5; } ;; #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'none needed') :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ac_c_undeclared_builtin_options='' ;; #(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *) :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-esac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> ac_fn_check_decl "$LINENO" "atomic_compare_exchange_strong_explicit" "ac_cv_have_decl_atomic_compare_exchange_strong_explicit" "#include <stdatomic.h>
" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl_atomic_compare_exchange_strong_explicit" = xyes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9692,7 +9742,7 @@ printf "%s\n" "yes" >&6; }
</span>
# Output
<span style='display:block; white-space:pre;background:#ffe0e0;'>-ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/Makefile doc/base.mtree doc/macosx.mtree doc/macports.conf doc/prefix.mtree doc/pubkeys.conf portmgr/dmg/postflight setupenv.bash src/Makefile src/cregistry/Makefile src/compat/Makefile src/darwintracelib1.0/Makefile src/darwintracelib1.0/tests/Makefile src/machista1.0/Makefile src/macports1.0/Makefile src/macports1.0/macports_autoconf.tcl src/macports1.0/macports_test_autoconf.tcl src/mpcommon1.0/Makefile sr [...]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/Makefile doc/base.mtree doc/macosx.mtree doc/macports.conf doc/prefix.mtree doc/pubkeys.conf portmgr/dmg/postflight setupenv.bash src/Makefile src/cregistry/Makefile src/compat/Makefile src/darwintracelib1.0/Makefile src/darwintracelib1.0/tests/Makefile src/machista1.0/Makefile src/macports1.0/Makefile src/macports1.0/macports_autoconf.tcl src/macports1.0/macports_test_autoconf.tcl src/mpcommon1.0/Makefile sr [...]
</span>
ac_config_files="$ac_config_files vendor/tclsh"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -10435,6 +10485,7 @@ do
</span> "tests/test/library.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/library.tcl" ;;
"tests/test/trace/test.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/trace/test.tcl" ;;
"vendor/Makefile") CONFIG_FILES="$CONFIG_FILES vendor/Makefile" ;;
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ "vendor/signify-osx/autoconf.mk") CONFIG_FILES="$CONFIG_FILES vendor/signify-osx/autoconf.mk" ;;
</span> "vendor/tclsh") CONFIG_FILES="$CONFIG_FILES vendor/tclsh" ;;
"src/cxx_stdlib_overridden.tcl") CONFIG_FILES="$CONFIG_FILES src/cxx_stdlib_overridden.tcl" ;;
"src/dedup_portfiles.tcl") CONFIG_FILES="$CONFIG_FILES src/dedup_portfiles.tcl" ;;
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/configure.ac b/configure.ac
</span><span style='display:block; white-space:pre;color:#808080;'>index 8c1883b5a..6c64060bd 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/configure.ac
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/configure.ac
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -250,15 +250,24 @@ MP_UNIVERSAL_OPTIONS
</span>
# Check for standard header files.
AC_CHECK_HEADERS([crt_externs.h err.h fcntl.h libkern/OSAtomic.h libproc.h \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- limits.h paths.h pwd.h readline/history.h readline/readline.h \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- stdatomic.h spawn.h sys/attr.h sys/cdefs.h sys/clonefile.h sys/event.h \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sys/fcntl.h sys/file.h sys/paths.h sys/socket.h sys/sysctl.h utime.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ limits.h paths.h pwd.h readpassphrase.h readline/history.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ readline/readline.h stdatomic.h spawn.h sys/attr.h sys/cdefs.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sys/clonefile.h sys/event.h sys/fcntl.h sys/file.h sys/paths.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sys/socket.h sys/sysctl.h utime.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+AC_CHECK_DECLS([RPP_STDIN], [], [], [[#include <readpassphrase.h>]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+AC_SUBST(HAVE_DECL_RPP_STDIN, $ac_cv_have_decl_RPP_STDIN)
</span>
# Checks for library functions.
AC_CHECK_FUNCS([OSAtomicCompareAndSwap32 OSAtomicCompareAndSwap64 \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- OSAtomicCompareAndSwapPtr __getdirentries64 clearenv clonefile copyfile \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _dyld_shared_cache_contains_path flock fls kqueue posix_spawn setmode \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sysctlbyname])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OSAtomicCompareAndSwapPtr __getdirentries64 arc4random_buf clearenv \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ clonefile copyfile _dyld_shared_cache_contains_path flock fls \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ getentropy kqueue posix_spawn setmode sysctlbyname timingsafe_bcmp])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# For vendor/signify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+AC_SUBST(HAVE_ARC4RANDOM_BUF, $ac_cv_func_arc4random_buf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+AC_SUBST(HAVE_GETENTROPY, $ac_cv_func_getentropy)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+AC_SUBST(HAVE_TIMINGSAFE_BCMP, $ac_cv_func_timingsafe_bcmp)
</span>
# Check for library functions, replacements are in pextlib1.0/compat/
AC_CHECK_FUNCS([getline getdelim strlcat strlcpy])
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -447,6 +456,7 @@ AC_CONFIG_FILES([
</span> tests/test/library.tcl
tests/test/trace/test.tcl
vendor/Makefile
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ vendor/signify-osx/autoconf.mk
</span> ])
AC_CONFIG_FILES([vendor/tclsh], [chmod +x vendor/tclsh])
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/config.h.in b/src/config.h.in
</span><span style='display:block; white-space:pre;color:#808080;'>index 49b06de0e..0553ca736 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/config.h.in
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/config.h.in
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,6 +4,9 @@
</span> files before executing */
#undef DARWINTRACE_SIP_WORKAROUND_PATH
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Define to 1 if you have the 'arc4random_buf' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef HAVE_ARC4RANDOM_BUF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Define to 1 if you have the 'clearenv' function. */
#undef HAVE_CLEARENV
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,6 +46,10 @@
</span> 'rl_username_completion_function', and to 0 if you don't. */
#undef HAVE_DECL_RL_USERNAME_COMPLETION_FUNCTION
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Define to 1 if you have the declaration of 'RPP_STDIN', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef HAVE_DECL_RPP_STDIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Define to 1 if you have the declaration of 'SHA1_File', and to 0 if you
don't. */
#undef HAVE_DECL_SHA1_FILE
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -79,6 +86,9 @@
</span> /* Define to 1 if you have the 'getdelim' function. */
#undef HAVE_GETDELIM
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Define to 1 if you have the 'getentropy' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef HAVE_GETENTROPY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Define to 1 if you have the 'getline' function. */
#undef HAVE_GETLINE
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -145,6 +155,9 @@
</span> /* Define to 1 if you have the <readline/readline.h> header file. */
#undef HAVE_READLINE_READLINE_H
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Define to 1 if you have the <readpassphrase.h> header file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef HAVE_READPASSPHRASE_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Define to 1 if you have the <ripemd.h> header file. */
#undef HAVE_RIPEMD_H
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -223,6 +236,9 @@
</span> /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Define to 1 if you have the 'timingsafe_bcmp' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef HAVE_TIMINGSAFE_BCMP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Platform supports tracemode. */
#undef HAVE_TRACEMODE_SUPPORT
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/.gitignore b/vendor/signify-osx/.gitignore
</span><span style='display:block; white-space:pre;color:#808080;'>index c7264803a..96ee865ef 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/vendor/signify-osx/.gitignore
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/.gitignore
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,3 +1,4 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/autoconf.mk
</span> /explicit_bzero
/signify
/signify.1
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/Makefile b/vendor/signify-osx/Makefile
</span><span style='display:block; white-space:pre;color:#808080;'>index 7fd03a220..244f646bc 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/vendor/signify-osx/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,3 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+include autoconf.mk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> PREFIX= /usr/local
BINDIR= ${PREFIX}/bin
MANDIR= ${PREFIX}/share/man
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -21,6 +23,35 @@ SRCS+= src/usr.bin/signify/signify.c
</span> SRCS+= src/usr.bin/signify/sc25519.c
SRCS+= src/usr.bin/signify/zsig.c
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ifeq ($(HAVE_ARC4RANDOM_BUF),yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -DHAVE_ARC4RANDOM_BUF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -Isrc/lib/libcrypto
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+SRCS+= src/lib/libc/crypt/arc4random.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+INCL+= src/lib/libcrypto/arc4random/arc4random_osx.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+INCL+= src/lib/libc/crypt/chacha_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ifeq ($(HAVE_GETENTROPY),yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -DHAVE_GETENTROPY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+SRCS+= src/lib/libcrypto/arc4random/getentropy_osx.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ifeq ($(HAVE_DECL_RPP_STDIN),yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -DHAVE_DECL_RPP_STDIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+SRCS+= src/lib/libc/gen/readpassphrase.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+INCL+= src/include/readpassphrase.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -D_NSIG=NSIG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ifeq ($(HAVE_TIMINGSAFE_BCMP),yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CFLAGS+= -DHAVE_TIMINGSAFE_BCMP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+SRCS+= src/lib/libc/string/timingsafe_bcmp.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> INCL+= src/include/blf.h
INCL+= src/include/sha2.h
INCL+= src/lib/libutil/ohash.h
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -134,3 +165,6 @@ ls:
</span>
clean:
rm -rf signify signify.1 test-results explicit_bzero
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+distclean: clean
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -rm -f autoconf.mk
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/autoconf.mk.in b/vendor/signify-osx/autoconf.mk.in
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..7da96c2c7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/autoconf.mk.in
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,4 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_ARC4RANDOM_BUF= @HAVE_ARC4RANDOM_BUF@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_GETENTROPY= @HAVE_GETENTROPY@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_TIMINGSAFE_BCMP= @HAVE_TIMINGSAFE_BCMP@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+HAVE_DECL_RPP_STDIN= @HAVE_DECL_RPP_STDIN@
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/missing.h b/vendor/signify-osx/missing.h
</span><span style='display:block; white-space:pre;color:#808080;'>index 492515311..423ef2343 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/vendor/signify-osx/missing.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/missing.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2,3 +2,15 @@
</span>
void explicit_bzero(void *, size_t);
void freezero(void *, size_t);
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef HAVE_ARC4RANDOM_BUF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+void arc4random_buf(void *, size_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef HAVE_GETENTROPY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int getentropy(void *, size_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef HAVE_TIMINGSAFE_BCMP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int timingsafe_bcmp(const void *, const void *, size_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/include/readpassphrase.h b/vendor/signify-osx/src/include/readpassphrase.h
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..4ef538c62
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/include/readpassphrase.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,40 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: readpassphrase.h,v 1.6 2019/01/25 00:19:25 millert Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2000, 2002 Todd C. Miller <millert@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Sponsored in part by the Defense Advanced Research Projects
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef _READPASSPHRASE_H_
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define _READPASSPHRASE_H_
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_ECHO_ON 0x01 /* Leave echo on. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_FORCELOWER 0x04 /* Force input to lower case. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_FORCEUPPER 0x08 /* Force input to upper case. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/cdefs.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__BEGIN_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+char * readpassphrase(const char *, char *, size_t, int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__END_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* !_READPASSPHRASE_H_ */
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libc/crypt/arc4random.c b/vendor/signify-osx/src/lib/libc/crypt/arc4random.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..2da8e010a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libc/crypt/arc4random.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,204 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: arc4random.c,v 1.58 2022/07/31 13:41:45 tb Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ChaCha based random number generator for OpenBSD.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <limits.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <signal.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdint.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <string.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <unistd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define KEYSTREAM_ONLY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include "chacha_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define minimum(a, b) ((a) < (b) ? (a) : (b))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if defined(__GNUC__) || defined(_MSC_VER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define inline __inline
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#else /* __GNUC__ || _MSC_VER */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define inline
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* !__GNUC__ && !_MSC_VER */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define KEYSZ 32
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define IVSZ 8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define BLOCKSZ 64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define RSBUFSZ (16*BLOCKSZ)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static struct _rs {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t rs_have; /* valid bytes at end of rs_buf */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t rs_count; /* bytes till reseed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} *rs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Maybe be preserved in fork children, if _rs_allocate() decides. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static struct _rsx {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chacha_ctx rs_chacha; /* chacha context for random keystream */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_char rs_buf[RSBUFSZ]; /* keystream blocks */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} *rsx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline int _rs_allocate(struct _rs **, struct _rsx **);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void _rs_forkdetect(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include "arc4random.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void _rs_rekey(u_char *dat, size_t datlen);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_init(u_char *buf, size_t n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (n < KEYSZ + IVSZ)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (_rs_allocate(&rs, &rsx) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _exit(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chacha_ivsetup(&rsx->rs_chacha, buf + KEYSZ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_stir(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_char rnd[KEYSZ + IVSZ];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint32_t rekey_fuzz = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (getentropy(rnd, sizeof rnd) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _getentropy_fail();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!rs)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_init(rnd, sizeof(rnd));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_rekey(rnd, sizeof(rnd));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* invalidate rs_buf */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_have = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* rekey interval should not be predictable */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chacha_encrypt_bytes(&rsx->rs_chacha, (uint8_t *)&rekey_fuzz,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (uint8_t *)&rekey_fuzz, sizeof(rekey_fuzz));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_stir_if_needed(size_t len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_forkdetect();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!rs || rs->rs_count <= len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_stir();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs->rs_count <= len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_count -= len;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_rekey(u_char *dat, size_t datlen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef KEYSTREAM_ONLY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* fill rs_buf with the keystream */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chacha_encrypt_bytes(&rsx->rs_chacha, rsx->rs_buf,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rsx->rs_buf, sizeof(rsx->rs_buf));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* mix in optional user provided data */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (dat) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t i, m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m = minimum(datlen, KEYSZ + IVSZ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < m; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rsx->rs_buf[i] ^= dat[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* immediately reinit for backtracking resistance */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_init(rsx->rs_buf, KEYSZ + IVSZ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(rsx->rs_buf, 0, KEYSZ + IVSZ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_have = sizeof(rsx->rs_buf) - KEYSZ - IVSZ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_random_buf(void *_buf, size_t n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_char *buf = (u_char *)_buf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_char *keystream;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_stir_if_needed(n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (n > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs->rs_have > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m = minimum(n, rs->rs_have);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ keystream = rsx->rs_buf + sizeof(rsx->rs_buf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - rs->rs_have;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memcpy(buf, keystream, m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(keystream, 0, m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ buf += m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ n -= m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_have -= m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs->rs_have == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_rekey(NULL, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_random_u32(uint32_t *val)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_char *keystream;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_stir_if_needed(sizeof(*val));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs->rs_have < sizeof(*val))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_rekey(NULL, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memcpy(val, keystream, sizeof(*val));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(keystream, 0, sizeof(*val));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rs->rs_have -= sizeof(*val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+uint32_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+arc4random(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint32_t val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _ARC4_LOCK();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_random_u32(&val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _ARC4_UNLOCK();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+DEF_WEAK(arc4random);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+arc4random_buf(void *buf, size_t n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _ARC4_LOCK();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_random_buf(buf, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _ARC4_UNLOCK();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+DEF_WEAK(arc4random_buf);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libc/crypt/arc4random.h b/vendor/signify-osx/src/lib/libc/crypt/arc4random.h
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..05ef5b1f8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libc/crypt/arc4random.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <arc4random/arc4random_osx.h>
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libc/crypt/chacha_private.h b/vendor/signify-osx/src/lib/libc/crypt/chacha_private.h
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..b0427b6b3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libc/crypt/chacha_private.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,222 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+chacha-merged.c version 20080118
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+D. J. Bernstein
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Public domain.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+*/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: chacha_private.h,v 1.3 2022/02/28 21:56:29 dtucker Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+typedef unsigned char u8;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+typedef unsigned int u32;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+typedef struct
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u32 input[16]; /* could be compressed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} chacha_ctx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U8C(v) (v##U)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U32C(v) (v##U)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U8V(v) ((u8)(v) & U8C(0xFF))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U32V(v) ((u32)(v) & U32C(0xFFFFFFFF))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define ROTL32(v, n) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (U32V((v) << (n)) | ((v) >> (32 - (n))))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U8TO32_LITTLE(p) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (((u32)((p)[0]) ) | \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ((u32)((p)[1]) << 8) | \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ((u32)((p)[2]) << 16) | \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ((u32)((p)[3]) << 24))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define U32TO8_LITTLE(p, v) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ do { \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (p)[0] = U8V((v) ); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (p)[1] = U8V((v) >> 8); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (p)[2] = U8V((v) >> 16); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (p)[3] = U8V((v) >> 24); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } while (0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define ROTATE(v,c) (ROTL32(v,c))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define XOR(v,w) ((v) ^ (w))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define PLUS(v,w) (U32V((v) + (w)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define PLUSONE(v) (PLUS((v),1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define QUARTERROUND(a,b,c,d) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a = PLUS(a,b); d = ROTATE(XOR(d,a),16); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c = PLUS(c,d); b = ROTATE(XOR(b,c),12); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static const char sigma[16] = "expand 32-byte k";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static const char tau[16] = "expand 16-byte k";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *constants;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[4] = U8TO32_LITTLE(k + 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[5] = U8TO32_LITTLE(k + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[6] = U8TO32_LITTLE(k + 8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[7] = U8TO32_LITTLE(k + 12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (kbits == 256) { /* recommended */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ k += 16;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ constants = sigma;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else { /* kbits == 128 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ constants = tau;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[8] = U8TO32_LITTLE(k + 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[9] = U8TO32_LITTLE(k + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[10] = U8TO32_LITTLE(k + 8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[11] = U8TO32_LITTLE(k + 12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[0] = U8TO32_LITTLE(constants + 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[1] = U8TO32_LITTLE(constants + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[2] = U8TO32_LITTLE(constants + 8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[3] = U8TO32_LITTLE(constants + 12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+chacha_ivsetup(chacha_ctx *x,const u8 *iv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[12] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[13] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[14] = U8TO32_LITTLE(iv + 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[15] = U8TO32_LITTLE(iv + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u8 *ctarget = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u8 tmp[64];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!bytes) return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j0 = x->input[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j1 = x->input[1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j2 = x->input[2];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j3 = x->input[3];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j4 = x->input[4];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j5 = x->input[5];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j6 = x->input[6];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j7 = x->input[7];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j8 = x->input[8];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j9 = x->input[9];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j10 = x->input[10];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j11 = x->input[11];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j12 = x->input[12];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j13 = x->input[13];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j14 = x->input[14];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j15 = x->input[15];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (;;) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bytes < 64) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0;i < bytes;++i) tmp[i] = m[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m = tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ctarget = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c = tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x0 = j0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x1 = j1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x2 = j2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x3 = j3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x4 = j4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x5 = j5;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x6 = j6;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x7 = j7;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x8 = j8;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x9 = j9;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x10 = j10;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x11 = j11;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x12 = j12;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x13 = j13;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x14 = j14;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x15 = j15;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 20;i > 0;i -= 2) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x0, x4, x8,x12)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x1, x5, x9,x13)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x2, x6,x10,x14)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x3, x7,x11,x15)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x0, x5,x10,x15)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x1, x6,x11,x12)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x2, x7, x8,x13)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QUARTERROUND( x3, x4, x9,x14)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x0 = PLUS(x0,j0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x1 = PLUS(x1,j1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x2 = PLUS(x2,j2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x3 = PLUS(x3,j3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x4 = PLUS(x4,j4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x5 = PLUS(x5,j5);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x6 = PLUS(x6,j6);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x7 = PLUS(x7,j7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x8 = PLUS(x8,j8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x9 = PLUS(x9,j9);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x10 = PLUS(x10,j10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x11 = PLUS(x11,j11);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x12 = PLUS(x12,j12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x13 = PLUS(x13,j13);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x14 = PLUS(x14,j14);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x15 = PLUS(x15,j15);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef KEYSTREAM_ONLY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x0 = XOR(x0,U8TO32_LITTLE(m + 0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x1 = XOR(x1,U8TO32_LITTLE(m + 4));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x2 = XOR(x2,U8TO32_LITTLE(m + 8));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x3 = XOR(x3,U8TO32_LITTLE(m + 12));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x4 = XOR(x4,U8TO32_LITTLE(m + 16));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x5 = XOR(x5,U8TO32_LITTLE(m + 20));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x6 = XOR(x6,U8TO32_LITTLE(m + 24));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x7 = XOR(x7,U8TO32_LITTLE(m + 28));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x8 = XOR(x8,U8TO32_LITTLE(m + 32));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x9 = XOR(x9,U8TO32_LITTLE(m + 36));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x10 = XOR(x10,U8TO32_LITTLE(m + 40));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x11 = XOR(x11,U8TO32_LITTLE(m + 44));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x12 = XOR(x12,U8TO32_LITTLE(m + 48));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x13 = XOR(x13,U8TO32_LITTLE(m + 52));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x14 = XOR(x14,U8TO32_LITTLE(m + 56));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x15 = XOR(x15,U8TO32_LITTLE(m + 60));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j12 = PLUSONE(j12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!j12) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ j13 = PLUSONE(j13);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* stopping at 2^70 bytes per nonce is user's responsibility */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 0,x0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 4,x1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 8,x2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 12,x3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 16,x4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 20,x5);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 24,x6);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 28,x7);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 32,x8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 36,x9);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 40,x10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 44,x11);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 48,x12);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 52,x13);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 56,x14);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ U32TO8_LITTLE(c + 60,x15);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bytes <= 64) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bytes < 64) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0;i < bytes;++i) ctarget[i] = c[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[12] = j12;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ x->input[13] = j13;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bytes -= 64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c += 64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef KEYSTREAM_ONLY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m += 64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libc/gen/readpassphrase.c b/vendor/signify-osx/src/lib/libc/gen/readpassphrase.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..0e2aa3af5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libc/gen/readpassphrase.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,192 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: readpassphrase.c,v 1.27 2019/01/25 00:19:25 millert Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2000-2002, 2007, 2010
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Todd C. Miller <millert@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Sponsored in part by the Defense Advanced Research Projects
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <ctype.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <paths.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <pwd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <signal.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <string.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <termios.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <unistd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <readpassphrase.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static volatile sig_atomic_t signo[_NSIG];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void handler(int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssize_t nr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int input, output, save_errno, i, need_restart;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char ch, *p, *end;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct termios term, oterm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct sigaction savetstp, savettin, savettou, savepipe;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* I suppose we could alloc on demand in this case (XXX). */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bufsiz == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+restart:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < _NSIG; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signo[i] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ nr = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ save_errno = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ need_restart = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Read and write to /dev/tty if available. If not, read from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * stdin and write to stderr unless a tty is required.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((flags & RPP_STDIN) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (input = output = open(_PATH_TTY, O_RDWR)) == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (flags & RPP_REQUIRE_TTY) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = ENOTTY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ input = STDIN_FILENO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ output = STDERR_FILENO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Turn off echo if possible.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * If we are using a tty but are not the foreground pgrp this will
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * generate SIGTTOU, so do it *before* installing the signal handlers.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memcpy(&term, &oterm, sizeof(term));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!(flags & RPP_ECHO_ON))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ term.c_lflag &= ~(ECHO | ECHONL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ term.c_cc[VSTATUS] = _POSIX_VDISABLE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(&term, 0, sizeof(term));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ term.c_lflag |= ECHO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(&oterm, 0, sizeof(oterm));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ oterm.c_lflag |= ECHO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Catch signals that would otherwise cause the user to end
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * up with echo turned off in the shell. Don't worry about
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * things like SIGXCPU and SIGVTALRM for now.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigemptyset(&sa.sa_mask);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sa.sa_flags = 0; /* don't restart system calls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sa.sa_handler = handler;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGALRM, &sa, &savealrm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGHUP, &sa, &savehup);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGINT, &sa, &saveint);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGPIPE, &sa, &savepipe);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGQUIT, &sa, &savequit);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTERM, &sa, &saveterm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTSTP, &sa, &savetstp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTTIN, &sa, &savettin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTTOU, &sa, &savettou);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!(flags & RPP_STDIN))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)write(output, prompt, strlen(prompt));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ end = buf + bufsiz - 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p = buf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (p < end) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((flags & RPP_SEVENBIT))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ch &= 0x7f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (isalpha((unsigned char)ch)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((flags & RPP_FORCELOWER))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ch = (char)tolower((unsigned char)ch);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((flags & RPP_FORCEUPPER))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ch = (char)toupper((unsigned char)ch);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *p++ = ch;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *p = '\0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ save_errno = errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!(term.c_lflag & ECHO))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)write(output, "\n", 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Restore old terminal settings and signals. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (memcmp(&term, &oterm, sizeof(term)) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int sigttou = signo[SIGTTOU];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Ignore SIGTTOU generated when we are not the fg pgrp. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno == EINTR && !signo[SIGTTOU])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signo[SIGTTOU] = sigttou;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGALRM, &savealrm, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGHUP, &savehup, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGINT, &saveint, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGQUIT, &savequit, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGPIPE, &savepipe, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTERM, &saveterm, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTSTP, &savetstp, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTTIN, &savettin, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)sigaction(SIGTTOU, &savettou, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (input != STDIN_FILENO)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)close(input);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * If we were interrupted by a signal, resend it to ourselves
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * now that we have restored the signal handlers.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < _NSIG; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (signo[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ kill(getpid(), i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case SIGTSTP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case SIGTTIN:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case SIGTTOU:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ need_restart = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (need_restart)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto restart;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (save_errno)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = save_errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return(nr == -1 ? NULL : buf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+DEF_WEAK(readpassphrase);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+getpass(const char *prompt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static char buf[_PASSWORD_LEN + 1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static void handler(int s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signo[s] = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libc/string/timingsafe_bcmp.c b/vendor/signify-osx/src/lib/libc/string/timingsafe_bcmp.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..0409ec324
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libc/string/timingsafe_bcmp.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,30 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2010 Damien Miller. All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <string.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+timingsafe_bcmp(const void *b1, const void *b2, size_t n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const unsigned char *p1 = b1, *p2 = b2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (; n > 0; n--)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ret |= *p1++ ^ *p2++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ret != 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+DEF_WEAK(timingsafe_bcmp);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libcrypto/arc4random/arc4random_osx.h b/vendor/signify-osx/src/lib/libcrypto/arc4random/arc4random_osx.h
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..818ae6bbf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libcrypto/arc4random/arc4random_osx.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,81 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: arc4random_osx.h,v 1.11 2016/06/30 12:19:51 bcook Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Stub functions for portability.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/mman.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <pthread.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <signal.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_getentropy_fail(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise(SIGKILL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static volatile sig_atomic_t _rs_forked;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_forkhandler(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_forked = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_forkdetect(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static pid_t _rs_pid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pid_t pid = getpid();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_pid = pid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _rs_forked = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (rs)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(rs, 0, sizeof(*rs));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static inline int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ munmap(*rsp, sizeof(**rsp));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *rsp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _ARC4_ATFORK(_rs_forkhandler);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/vendor/signify-osx/src/lib/libcrypto/arc4random/getentropy_osx.c b/vendor/signify-osx/src/lib/libcrypto/arc4random/getentropy_osx.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..db028d19b
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/vendor/signify-osx/src/lib/libcrypto/arc4random/getentropy_osx.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,417 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* $OpenBSD: getentropy_osx.c,v 1.14 2021/10/24 21:24:20 deraadt Exp $ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2014 Bob Beck <beck@obtuse.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Emulation of getentropy(2) as documented at:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * http://man.openbsd.org/getentropy.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <TargetConditionals.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/param.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/ioctl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/resource.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/syscall.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/sysctl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/statvfs.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/socket.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/mount.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/mman.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/stat.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdint.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdio.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <termios.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <signal.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <string.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <unistd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <mach/mach_time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <mach/mach_host.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <mach/host_info.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if TARGET_OS_OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/socketvar.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <sys/vmmeter.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/in.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/tcp.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if TARGET_OS_OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/udp.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/ip_var.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/tcp_var.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <netinet/udp_var.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <CommonCrypto/CommonDigest.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define SHA512_Update(a, b, c) (CC_SHA512_Update((a), (b), (c)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define SHA512_Init(xxx) (CC_SHA512_Init((xxx)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define SHA512_Final(xxx, yyy) (CC_SHA512_Final((xxx), (yyy)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define SHA512_CTX CC_SHA512_CTX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define SHA512_DIGEST_LENGTH CC_SHA512_DIGEST_LENGTH
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define REPEAT 5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define HX(a, b) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ do { \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((a)) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(errno); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(b); \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } while (0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int getentropy(void *buf, size_t len);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int getentropy_urandom(void *buf, size_t len);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int getentropy_fallback(void *buf, size_t len);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+getentropy(void *buf, size_t len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int ret = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (len > 256) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = EIO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Try to get entropy with /dev/urandom
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * This can fail if the process is inside a chroot or if file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * descriptors are exhausted.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ret = getentropy_urandom(buf, len);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ret != -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Entropy collection via /dev/urandom and sysctl have failed.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * No other API exists for collecting entropy, and we have
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * no failsafe way to get it on OSX that is not sensitive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * to resource exhaustion.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * We have very few options:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * - Even syslog_r is unsafe to call at this low level, so
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * there is no way to alert the user or program.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * - Cannot call abort() because some systems have unsafe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * corefiles.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * - Could raise(SIGKILL) resulting in silent program termination.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * - Return EIO, to hint that arc4random's stir function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * should raise(SIGKILL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * - Do the best under the circumstances....
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * This code path exists to bring light to the issue that OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * does not provide a failsafe API for entropy collection.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * We hope this demonstrates that OSX should consider
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * providing a new failsafe API which works in a chroot or
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * when file descriptors are exhausted.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#undef FAIL_INSTEAD_OF_TRYING_FALLBACK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef FAIL_INSTEAD_OF_TRYING_FALLBACK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise(SIGKILL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ret = getentropy_fallback(buf, len);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ret != -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = EIO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+getentropy_urandom(void *buf, size_t len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct stat st;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int fd, flags;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int save_errno = errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+start:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flags = O_RDONLY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef O_NOFOLLOW
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flags |= O_NOFOLLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef O_CLOEXEC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flags |= O_CLOEXEC;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fd = open("/dev/urandom", flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (fd == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (errno == EINTR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto start;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto nodevrandom;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef O_CLOEXEC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Lightly verify that the device node looks sane */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto nodevrandom;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < len; ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t wanted = len - i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssize_t ret = read(fd, (char *)buf + i, wanted);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ret == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (errno == EAGAIN || errno == EINTR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto nodevrandom;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ i += ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = save_errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0); /* satisfied */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+nodevrandom:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = EIO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if TARGET_OS_OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int tcpmib[] = { CTL_NET, AF_INET, IPPROTO_TCP, TCPCTL_STATS };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int udpmib[] = { CTL_NET, AF_INET, IPPROTO_UDP, UDPCTL_STATS };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int ipmib[] = { CTL_NET, AF_INET, IPPROTO_IP, IPCTL_STATS };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int kmib[] = { CTL_KERN, KERN_USRSTACK };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int hwmib[] = { CTL_HW, HW_USERMEM };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+getentropy_fallback(void *buf, size_t len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint8_t results[SHA512_DIGEST_LENGTH];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int save_errno = errno, e, pgs = getpagesize(), faster = 0, repeat;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int cnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct timespec ts;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct timeval tv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct rusage ru;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigset_t sigset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct stat st;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SHA512_CTX ctx;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static pid_t lastpid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pid_t pid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t i, ii, m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if TARGET_OS_OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct tcpstat tcpstat;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct udpstat udpstat;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct ipstat ipstat;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u_int64_t mach_time;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unsigned int idata;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void *addr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pid = getpid();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (lastpid == pid) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ faster = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ repeat = 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ faster = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lastpid = pid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ repeat = REPEAT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < len; ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int j;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SHA512_Init(&ctx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (j = 0; j < repeat; j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = gettimeofday(&tv, NULL)) == -1, tv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (e != -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)tv.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)tv.tv_usec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mach_time = mach_absolute_time();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(mach_time);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ii = sizeof(addr);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sysctl(kmib, sizeof(kmib) / sizeof(kmib[0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &addr, &ii, NULL, 0) == -1, addr);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ii = sizeof(idata);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sysctl(hwmib, sizeof(hwmib) / sizeof(hwmib[0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &idata, &ii, NULL, 0) == -1, idata);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if TARGET_OS_OSX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ii = sizeof(tcpstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sysctl(tcpmib, sizeof(tcpmib) / sizeof(tcpmib[0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &tcpstat, &ii, NULL, 0) == -1, tcpstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ii = sizeof(udpstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sysctl(udpmib, sizeof(udpmib) / sizeof(udpmib[0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &udpstat, &ii, NULL, 0) == -1, udpstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ii = sizeof(ipstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sysctl(ipmib, sizeof(ipmib) / sizeof(ipmib[0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &ipstat, &ii, NULL, 0) == -1, ipstat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((pid = getpid()) == -1, pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((pid = getsid(pid)) == -1, pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((pid = getppid()) == -1, pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((pid = getpgid(0)) == -1, pid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = getpriority(0, 0)) == -1, e);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!faster) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ts.tv_sec = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ts.tv_nsec = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void) nanosleep(&ts, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sigpending(&sigset) == -1, sigset);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigset);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HF(getentropy); /* an addr in this library */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HF(printf); /* an addr in libc */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p = (char *)&p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(p); /* an addr on stack */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p = (char *)&errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(p); /* the addr of errno */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (i == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct sockaddr_storage ss;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct statvfs stvfs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct termios tios;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct statfs stfs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ socklen_t ssl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ off_t off;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Prime-sized mappings encourage fragmentation;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * thus exposing some address entropy.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct mm {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t npg;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void *p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } mm[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 17, MAP_FAILED }, { 3, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 11, MAP_FAILED }, { 2, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 5, MAP_FAILED }, { 3, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 7, MAP_FAILED }, { 1, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 57, MAP_FAILED }, { 3, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { 131, MAP_FAILED }, { 1, MAP_FAILED },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (m = 0; m < sizeof mm/sizeof(mm[0]); m++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(mm[m].p = mmap(NULL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mm[m].npg * pgs,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PROT_READ|PROT_WRITE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MAP_PRIVATE|MAP_ANON, -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (off_t)0), mm[m].p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (mm[m].p != MAP_FAILED) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t mo;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Touch some memory... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p = mm[m].p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mo = cnt %
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (mm[m].npg * pgs - 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p[mo] = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)((long)(mm[m].p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ / pgs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Check cnts and times... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mach_time = mach_absolute_time();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(mach_time);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)mach_time;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = getrusage(RUSAGE_SELF,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &ru)) == -1, ru);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (e != -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)ru.ru_utime.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)ru.ru_utime.tv_usec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (m = 0; m < sizeof mm/sizeof(mm[0]); m++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (mm[m].p != MAP_FAILED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ munmap(mm[m].p, mm[m].npg * pgs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mm[m].p = MAP_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(stat(".", &st) == -1, st);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(statvfs(".", &stvfs) == -1, stvfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(statfs(".", &stfs) == -1, stfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(stat("/", &st) == -1, st);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(statvfs("/", &stvfs) == -1, stvfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(statfs("/", &stfs) == -1, stfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = fstat(0, &st)) == -1, st);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (e == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (S_ISREG(st.st_mode) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ S_ISFIFO(st.st_mode) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ S_ISSOCK(st.st_mode)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(fstatvfs(0, &stvfs) == -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stvfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(fstatfs(0, &stfs) == -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stfs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((off = lseek(0, (off_t)0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SEEK_CUR)) < 0, off);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (S_ISCHR(st.st_mode)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(tcgetattr(0, &tios) == -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tios);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else if (S_ISSOCK(st.st_mode)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memset(&ss, 0, sizeof ss);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl = sizeof(ss);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX(getpeername(0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void *)&ss, &ssl) == -1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ss);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = getrusage(RUSAGE_CHILDREN,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &ru)) == -1, ru);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (e != -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)ru.ru_utime.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)ru.ru_utime.tv_usec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Subsequent hashes absorb previous result */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(results);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HX((e = gettimeofday(&tv, NULL)) == -1, tv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (e != -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)tv.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cnt += (int)tv.tv_usec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HD(cnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SHA512_Final(results, &ctx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ i += MINIMUM(sizeof(results), len - i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ explicit_bzero(&ctx, sizeof ctx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ explicit_bzero(results, sizeof results);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = save_errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0); /* satisfied */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span></pre><pre style='margin:0'>
</pre>