[AC 21.5] Fix TLS-related build failures
10 years, 2 months
Jerry James
APPROVE COMMIT 21.5
This patch fixes the build failure exhibited by the buildbot: the
OpenSSL code contains a blatant Fedoraism. It is now a useless call
("set your list of ciphers to the default") to make it easy for
distributions to customize the list. The call does no harm as is.
Also, there are some malformed macros in the !WITH_TLS case, which
this patch also fixes.
I will commit this patch shortly.
diff -r a216b3c2b09e src/ChangeLog
--- a/src/ChangeLog Tue Oct 07 21:16:10 2014 -0600
+++ b/src/ChangeLog Wed Oct 08 12:53:18 2014 -0600
@@ -1,3 +1,11 @@
+2014-10-08 Jerry James <james(a)xemacs.org>
+
+ * tls.c (init_tls): Remove blatant Fedoraism from the OpenSSL version.
+ * tls.h (tls_open):
+ (make_tls_input_stream):
+ (make_tls_output_stream):
+ (tls_get_fd): Fix build failures in the !WITH_TLS case.
+
2014-10-07 Jerry James <james(a)xemacs.org>
* Makefile.in.in: Add tls.o to the link.
diff -r a216b3c2b09e src/tls.c
--- a/src/tls.c Tue Oct 07 21:16:10 2014 -0600
+++ b/src/tls.c Wed Oct 08 12:53:18 2014 -0600
@@ -1116,7 +1116,7 @@
SSL_MODE_AUTO_RETRY | SSL_MODE_RELEASE_BUFFERS);
/* Let the system select the ciphers */
- if (SSL_CTX_set_cipher_list (ssl_ctx, "PROFILE=SYSTEM") != 1)
+ if (SSL_CTX_set_cipher_list (ssl_ctx, "DEFAULT") != 1)
signal_error (Qtls_error, "SSL_CTX_set_cipher_list failed",
openssl_error_string ());
diff -r a216b3c2b09e src/tls.h
--- a/src/tls.h Tue Oct 07 21:16:10 2014 -0600
+++ b/src/tls.h Wed Oct 08 12:53:18 2014 -0600
@@ -80,14 +80,17 @@
#else /* WITH_TLS */
typedef int tls_state_t;
#define TLS_SETUP_SOCK 1
-#define tls_open(x,y) \
- signal_error (Qtls_error, "TLS support unavailable", Qnil), NULL
+#define tls_open(x,y) ({ \
+ signal_error (Qtls_error, "TLS support unavailable", Qnil); \
+ NULL; })
#define tls_negotiate(x,y,z) NULL
-#define make_tls_input_stream(x) \
- signal_error (Qtls_error, "TLS support unavailable", Qnil), NULL
-#define make_tls_output_stream(x) \
- signal_error (Qtls_error, "TLS support unavailable", Qnil), NULL
-#define tls_get_fd(x, y) -1
+#define make_tls_input_stream(x) ({ \
+ signal_error (Qtls_error, "TLS support unavailable", Qnil); \
+ NULL; })
+#define make_tls_output_stream(x) ({ \
+ signal_error (Qtls_error, "TLS support unavailable", Qnil); \
+ NULL; })
+#define tls_get_fd(x) -1
#define tls_read(w,x,y,z) -1
#define tls_write(w,x,y,z) -1
#define tls_close(x) -1
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: Jerry James: Add TLS support. See xemacs-patches message with ID
10 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/a216b3c2b09e/
Changeset: a216b3c2b09e
User: Jerry James
Date: 2014-10-08 03:16:10+00:00
Summary: Add TLS support. See xemacs-patches message with ID
<CAHCOHQk6FNm2xf=XiGEpPq43+7WOzNZ=SuD9V79o3wb9WVCTrQ(a)mail.gmail.com>.
Affected #: 27 files
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-07 Jerry James <james(a)xemacs.org>
+
+ * configure.ac: Add TLS support.
+
2014-02-11 Jerry James <james(a)xemacs.org>
* .hgignore: Add man/Makefile.
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 configure
--- a/configure
+++ b/configure
@@ -1006,6 +1006,8 @@
with_dnet
enable_ipv6_cname
with_ipv6_cname
+enable_tls
+with_tls
enable_rel_alloc
with_rel_alloc
enable_dlmalloc
@@ -1938,6 +1940,9 @@
--with-ipv6-cname Try IPv6 information first when canonicalizing host
names. This option has no effect unless system
supports getaddrinfo(3) and getnameinfo(3).
+ --with-tls=TYPE Support TLS connections. TYPE must be one of "nss",
+ "gnutls", and "openssl". If TYPE is omitted or
+ "yes", support is determined automatically.
Memory allocation options
-------------------------
@@ -4922,6 +4927,22 @@
else
with_ipv6_cname="no"
fi;
+# If --with-tls or --without-tls were given then copy the value to the
+# equivalent enable_tls variable.
+if test "${with_tls+set}" = set; then
+ enable_tls="$with_tls"
+fi;
+# If -enable-tls or --disable-tls were given then copy the value to the
+# equivalent with_tls variable.
+if test "${enable_tls+set}" = set; then
+ with_tls="$enable_tls"
+fi;
+# Check whether --with-tls or --without-tls was given.
+if test "${with_tls+set}" = set; then
+ enableval="$with_tls"
+ withval="$with_tls"
+
+fi;
# If --with-rel-alloc or --without-rel-alloc were given then copy the value to the
# equivalent enable_rel-alloc variable.
@@ -21000,6 +21021,318 @@
fi
+if test "$with_tls" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_global_init in -lgnutls" >&5
+$as_echo_n "checking for gnutls_global_init in -lgnutls... " >&6; }
+if ${ac_cv_lib_gnutls_gnutls_global_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgnutls $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gnutls_global_init ();
+int
+main ()
+{
+return gnutls_global_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gnutls_gnutls_global_init=yes
+else
+ ac_cv_lib_gnutls_gnutls_global_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_global_init" >&5
+$as_echo "$ac_cv_lib_gnutls_gnutls_global_init" >&6; }
+if test "x$ac_cv_lib_gnutls_gnutls_global_init" = xyes; then :
+ with_tls=gnutls
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS_InitContext in -lnss3" >&5
+$as_echo_n "checking for NSS_InitContext in -lnss3... " >&6; }
+if ${ac_cv_lib_nss3_NSS_InitContext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnss3 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char NSS_InitContext ();
+int
+main ()
+{
+return NSS_InitContext ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nss3_NSS_InitContext=yes
+else
+ ac_cv_lib_nss3_NSS_InitContext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_NSS_InitContext" >&5
+$as_echo "$ac_cv_lib_nss3_NSS_InitContext" >&6; }
+if test "x$ac_cv_lib_nss3_NSS_InitContext" = xyes; then :
+ with_tls=nss
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
+$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_library_init ();
+int
+main ()
+{
+return SSL_library_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_SSL_library_init=yes
+else
+ ac_cv_lib_ssl_SSL_library_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
+if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
+ with_tls=openssl
+else
+ with_tls=no
+fi
+
+fi
+
+fi
+
+elif test "$with_tls" = "gnutls"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_global_init in -lgnutls" >&5
+$as_echo_n "checking for gnutls_global_init in -lgnutls... " >&6; }
+if ${ac_cv_lib_gnutls_gnutls_global_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgnutls $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gnutls_global_init ();
+int
+main ()
+{
+return gnutls_global_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gnutls_gnutls_global_init=yes
+else
+ ac_cv_lib_gnutls_gnutls_global_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_global_init" >&5
+$as_echo "$ac_cv_lib_gnutls_gnutls_global_init" >&6; }
+if test "x$ac_cv_lib_gnutls_gnutls_global_init" = xyes; then :
+ with_tls=gnutls
+else
+ { echo "Error:" "Required gnutls support cannot be provided." >&2; exit 1; }
+fi
+
+elif test "$with_tls" = "nss"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS_InitContext in -lnss3" >&5
+$as_echo_n "checking for NSS_InitContext in -lnss3... " >&6; }
+if ${ac_cv_lib_nss3_NSS_InitContext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnss3 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char NSS_InitContext ();
+int
+main ()
+{
+return NSS_InitContext ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nss3_NSS_InitContext=yes
+else
+ ac_cv_lib_nss3_NSS_InitContext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_NSS_InitContext" >&5
+$as_echo "$ac_cv_lib_nss3_NSS_InitContext" >&6; }
+if test "x$ac_cv_lib_nss3_NSS_InitContext" = xyes; then :
+ with_tls=nss
+else
+ { echo "Error:" "Required NSS support cannot be provided." >&2; exit 1; }
+fi
+
+elif test "$with_tls" = "openssl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
+$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_library_init ();
+int
+main ()
+{
+return SSL_library_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_SSL_library_init=yes
+else
+ ac_cv_lib_ssl_SSL_library_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
+if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
+ with_tls=openssl
+else
+ { echo "Error:" "Required openssl support cannot be provided." >&2; exit 1; }
+fi
+
+fi
+if test "$with_tls" != "no"; then
+ $as_echo "#define WITH_TLS 1" >>confdefs.h
+
+ if test "$with_tls" = "gnutls"; then
+ $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h
+
+ gnutls_cflags=`pkg-config --cflags gnutls`
+ if test "$?" = 0; then
+ CPPFLAGS=""$gnutls_cflags" $CPPFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$gnutls_cflags"\" to \$CPPFLAGS"; fi
+ fi
+ gnutls_libs=`pkg-config --libs gnutls`
+ if test "$?" = 0; then
+ LDFLAGS=""$gnutls_libs" $LDFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$gnutls_libs"\" to \$LDFLAGS"; fi
+ fi
+ ac_fn_c_check_func "$LINENO" "gnutls_certificate_verification_status_print" "ac_cv_func_gnutls_certificate_verification_status_print"
+if test "x$ac_cv_func_gnutls_certificate_verification_status_print" = xyes; then :
+ $as_echo "#define HAVE_GNUTLS_CERTIFICATE_VERIFICATION_STATUS_PRINT 1" >>confdefs.h
+
+fi
+
+ ac_fn_c_check_func "$LINENO" "gnutls_certificate_verify_peers3" "ac_cv_func_gnutls_certificate_verify_peers3"
+if test "x$ac_cv_func_gnutls_certificate_verify_peers3" = xyes; then :
+ $as_echo "#define HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS3 1" >>confdefs.h
+
+fi
+
+ elif test "$with_tls" = "nss"; then
+ $as_echo "#define HAVE_NSS 1" >>confdefs.h
+
+ nss_cflags=`pkg-config --cflags nss`
+ if test "$?" = 0; then
+ CPPFLAGS=""$nss_cflags" $CPPFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$nss_cflags"\" to \$CPPFLAGS"; fi
+ fi
+ nss_libs=`pkg-config --libs nss`
+ if test "$?" = 0; then
+ LDFLAGS=""$nss_libs" $LDFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$nss_libs"\" to \$LDFLAGS"; fi
+ fi
+ else
+ $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
+
+ openssl_cflags=`pkg-config --cflags openssl`
+ if test "$?" = 0; then
+ CPPFLAGS=""$openssl_cflags" $CPPFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$openssl_cflags"\" to \$CPPFLAGS"; fi
+ fi
+ openssl_libs=`pkg-config --libs openssl`
+ if test "$?" = 0; then
+ LDFLAGS=""$openssl_libs" $LDFLAGS" && if test "$verbose" = "yes"; then echo " Prepending \""$openssl_libs"\" to \$LDFLAGS"; fi
+ fi
+ ac_fn_c_check_func "$LINENO" "X509_check_host" "ac_cv_func_X509_check_host"
+if test "x$ac_cv_func_X509_check_host" = xyes; then :
+ $as_echo "#define HAVE_X509_CHECK_HOST 1" >>confdefs.h
+
+fi
+
+ fi
+fi
+
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -21806,12 +22139,18 @@
test -n "$with_mail_locking" && echo " Compiling in support for \"$with_mail_locking\" mail spool file locking method."
echo "
-Other Features:"
+Network:"
test "$with_ipv6_cname" = no && echo " Inhibiting IPv6 canonicalization at startup."
test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk."
test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop."
test "$with_socks" = yes && echo " Compiling in support for SOCKS."
test "$with_dnet" = yes && echo " Compiling in support for DNET."
+test "$with_tls" = nss && echo " Compiling in support for TLS with NSS."
+test "$with_tls" = gnutls && echo " Compiling in support for TLS with gnutls."
+test "$with_tls" = openssl && echo " Compiling in support for TLS with OpenSSL."
+
+echo "
+Other Features:"
test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules."
test "$with_bignum" = "gmp" && echo " Compiling in support for more number types using the GNU MP library."
test "$with_bignum" = "mpir" && echo " Compiling in support for more number types using the MPIR library."
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -917,6 +917,9 @@
XE_MERGED_ARG([ipv6-cname],
AS_HELP_STRING([--with-ipv6-cname],[Try IPv6 information first when canonicalizing host names. This option has no effect unless system supports getaddrinfo(3) and getnameinfo(3).]),
[], [with_ipv6_cname="no"])
+XE_MERGED_ARG([tls],
+ AS_HELP_STRING([--with-tls=TYPE],[Support TLS connections. TYPE must be one of "nss", "gnutls", and "openssl". If TYPE is omitted or "yes", support is determined automatically.]),
+ [], [])
dnl
XE_HELP_SUBSECTION([Memory allocation options])
XE_MERGED_ARG([rel-alloc],
@@ -5328,6 +5331,61 @@
AC_DEFINE(WITH_MP)
fi
+dnl TLS support
+if test "$with_tls" = "yes"; then
+ AC_CHECK_LIB(gnutls, gnutls_global_init, [with_tls=gnutls],
+ AC_CHECK_LIB(nss3, NSS_InitContext, [with_tls=nss],
+ AC_CHECK_LIB(ssl, SSL_library_init, [with_tls=openssl], [with_tls=no])))
+elif test "$with_tls" = "gnutls"; then
+ AC_CHECK_LIB(gnutls, gnutls_global_init, [with_tls=gnutls],
+ [XE_DIE("Required gnutls support cannot be provided.")])
+elif test "$with_tls" = "nss"; then
+ AC_CHECK_LIB(nss3, NSS_InitContext, [with_tls=nss],
+ [XE_DIE("Required NSS support cannot be provided.")])
+elif test "$with_tls" = "openssl"; then
+ AC_CHECK_LIB(ssl, SSL_library_init, [with_tls=openssl],
+ [XE_DIE("Required openssl support cannot be provided.")])
+fi
+if test "$with_tls" != "no"; then
+ AC_DEFINE(WITH_TLS)
+ if test "$with_tls" = "gnutls"; then
+ AC_DEFINE(HAVE_GNUTLS)
+ gnutls_cflags=`pkg-config --cflags gnutls`
+ if test "$?" = 0; then
+ XE_PREPEND("$gnutls_cflags", CPPFLAGS)
+ fi
+ gnutls_libs=`pkg-config --libs gnutls`
+ if test "$?" = 0; then
+ XE_PREPEND("$gnutls_libs", LDFLAGS)
+ fi
+ AC_CHECK_FUNC(gnutls_certificate_verification_status_print,
+ [AC_DEFINE(HAVE_GNUTLS_CERTIFICATE_VERIFICATION_STATUS_PRINT)])
+ AC_CHECK_FUNC(gnutls_certificate_verify_peers3,
+ [AC_DEFINE(HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS3)])
+ elif test "$with_tls" = "nss"; then
+ AC_DEFINE(HAVE_NSS)
+ nss_cflags=`pkg-config --cflags nss`
+ if test "$?" = 0; then
+ XE_PREPEND("$nss_cflags", CPPFLAGS)
+ fi
+ nss_libs=`pkg-config --libs nss`
+ if test "$?" = 0; then
+ XE_PREPEND("$nss_libs", LDFLAGS)
+ fi
+ else
+ AC_DEFINE(HAVE_OPENSSL)
+ openssl_cflags=`pkg-config --cflags openssl`
+ if test "$?" = 0; then
+ XE_PREPEND("$openssl_cflags", CPPFLAGS)
+ fi
+ openssl_libs=`pkg-config --libs openssl`
+ if test "$?" = 0; then
+ XE_PREPEND("$openssl_libs", LDFLAGS)
+ fi
+ AC_CHECK_FUNC(X509_check_host, [AC_DEFINE(HAVE_X509_CHECK_HOST)])
+ fi
+fi
+
dnl Unfortunately, just because we can link doesn't mean we can run.
dnl One of the above link tests may have succeeded but caused resulting
dnl executables to fail to run. Also any tests using AC_RUN_IFELSE will
@@ -5959,12 +6017,18 @@
test -n "$with_mail_locking" && echo " Compiling in support for \"$with_mail_locking\" mail spool file locking method."
echo "
-Other Features:"
+Network:"
test "$with_ipv6_cname" = no && echo " Inhibiting IPv6 canonicalization at startup."
test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk."
test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop."
test "$with_socks" = yes && echo " Compiling in support for SOCKS."
test "$with_dnet" = yes && echo " Compiling in support for DNET."
+test "$with_tls" = nss && echo " Compiling in support for TLS with NSS."
+test "$with_tls" = gnutls && echo " Compiling in support for TLS with gnutls."
+test "$with_tls" = openssl && echo " Compiling in support for TLS with OpenSSL."
+
+echo "
+Other Features:"
test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules."
test "$with_bignum" = "gmp" && echo " Compiling in support for more number types using the GNU MP library."
test "$with_bignum" = "mpir" && echo " Compiling in support for more number types using the MPIR library."
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2014-10-07 Jerry James <james(a)xemacs.org>
+
+ * code-process.el (network-stream-get-response):
+ (network-stream-command):
+ (network-stream-open-plain):
+ (network-stream-open-tls):
+ (network-stream-certificate):
+ (network-stream-open-starttls):
+ (network-stream-open-shell): New functions.
+ (open-network-stream): Accept Emacs-compatible arguments.
+
2014-09-27 Michael Sperber <mike(a)xemacs.org>
* custom.el (defcustom):
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 lisp/code-process.el
--- a/lisp/code-process.el
+++ b/lisp/code-process.el
@@ -271,9 +271,169 @@
See also the function `find-operation-coding-system'.")
-(defun open-network-stream (name buffer host service &optional protocol)
+(defun network-stream-get-response (stream start end-of-command)
+ (when end-of-command
+ (with-current-buffer (process-buffer stream)
+ (save-excursion
+ (goto-char start)
+ (while (and (memq (process-status stream) '(open run))
+ (not (re-search-forward end-of-command nil t)))
+ (accept-process-output stream 0 50)
+ (goto-char start))
+ ;; Return the data we got back, or nil if the process died.
+ (unless (= start (point))
+ (buffer-substring start (point)))))))
+
+(defun network-stream-command (stream command eoc)
+ (when command
+ (let ((start (point-max (process-buffer stream))))
+ (process-send-string stream command)
+ (network-stream-get-response stream start eoc))))
+
+(defun network-stream-open-plain (name buffer host service parameters)
+ (let ((start (point buffer))
+ (stream
+ (open-network-stream-internal name buffer host service
+ (plist-get parameters :protocol))))
+ (list stream
+ (network-stream-get-response stream start
+ (plist-get parameters :end-of-command))
+ nil
+ 'plain)))
+
+(defun network-stream-open-tls (name buffer host service parameters)
+ (with-current-buffer buffer
+ (let* ((start (point-max))
+ (stream
+ (open-network-stream-internal name buffer host service
+ (plist-get parameters :protocol) t)))
+ (if (null stream)
+ (list nil nil nil 'plain)
+ (let ((eoc (plist-get parameters :end-of-command))
+ (capability-command (plist-get parameters :capability-command)))
+ (list stream
+ (network-stream-get-response stream start eoc)
+ (network-stream-command stream capability-command eoc)
+ 'tls))))))
+
+(defun network-stream-certificate (host service parameters)
+ (let ((spec (plist-get :client-certificate parameters)))
+ (cond
+ ((listp spec)
+ ;; Either nil or a list with a key/certificate pair.
+ spec)
+ ((eq spec t)
+ (when (fboundp 'auth-source-search)
+ (let* ((auth-info
+ (car (auth-source-search :max 1
+ :host host
+ :port service)))
+ (key (plist-get auth-info :key))
+ (cert (plist-get auth-info :cert)))
+ (and key cert
+ (list key cert))))))))
+
+(defun network-stream-open-starttls (name buffer host service parameters)
+ (let* ((start (point buffer))
+ (require-tls (eq (plist-get parameters :type) 'starttls))
+ (starttls-function (plist-get parameters :starttls-function))
+ (success-string (plist-get parameters :success))
+ (capability-command (plist-get parameters :capability-command))
+ (eoc (plist-get parameters :end-of-command))
+ (eo-capa (or (plist-get parameters :end-of-capability) eoc))
+ (protocol (plist-get parameters :protocol))
+ ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE)
+ (stream (open-network-stream-internal name buffer host service
+ protocol))
+ (greeting (and (not (plist-get parameters :nogreeting))
+ (network-stream-get-response stream start eoc)))
+ (capabilities (network-stream-command stream capability-command
+ eo-capa))
+ (resulting-type 'plain)
+ starttls-available starttls-command error)
+
+ ;; First check whether the server supports STARTTLS at all.
+ (when (and capabilities success-string starttls-function)
+ (setq starttls-command
+ (funcall starttls-function capabilities)))
+ ;; If we have built-in STARTTLS support, try to upgrade the
+ ;; connection.
+ (when (and starttls-command
+ (setq starttls-available t)
+ (not (eq (plist-get parameters :type) 'plain)))
+ (when (let ((response
+ (network-stream-command stream starttls-command eoc)))
+ (and response (string-match success-string response)))
+ ;; The server said it was OK to begin STARTTLS negotiations.
+ (let ((cert (network-stream-certificate host service parameters)))
+ (condition-case nil
+ (tls-negotiate stream host (and cert (list cert)))
+ ;; If we get a tls-specific error (for instance if the
+ ;; certificate the server gives us is completely syntactically
+ ;; invalid), then close the connection and possibly (further
+ ;; down) try to create a non-encrypted connection.
+ (gnutls-error (delete-process stream))))
+ (if (memq (process-status stream) '(open run))
+ (setq resulting-type 'tls)
+ ;; We didn't successfully negotiate STARTTLS; if TLS
+ ;; isn't demanded, reopen an unencrypted connection.
+ (unless require-tls
+ (setq stream
+ (make-network-process :name name :buffer buffer
+ :host host :service service))
+ (network-stream-get-response stream start eoc)))
+ ;; Re-get the capabilities, which may have now changed.
+ (setq capabilities
+ (network-stream-command stream capability-command eo-capa))))
+
+ ;; If TLS is mandatory, close the connection if it's unencrypted.
+ (when (and require-tls
+ ;; ... but Emacs wasn't able to -- either no built-in
+ ;; support, or no gnutls-cli installed.
+ (eq resulting-type 'plain))
+ (setq error
+ (if (or (null starttls-command)
+ starttls-available)
+ "Server does not support TLS"
+ ;; See `starttls-available-p'. If this predicate
+ ;; changes to allow running under Windows, the error
+ ;; message below should be amended.
+ (if (memq system-type '(windows-nt ms-dos))
+ (concat "Emacs does not support TLS")
+ (concat "Emacs does not support TLS, and no external `"
+ (if starttls-use-gnutls
+ starttls-gnutls-program
+ starttls-program)
+ "' program was found"))))
+ (delete-process stream)
+ (setq stream nil))
+ ;; Return value:
+ (list stream greeting capabilities resulting-type error)))
+
+;; Requires that format-spec.el from gnus be loaded
+(defun network-stream-open-shell (name buffer host service parameters)
+ (require 'format-spec)
+ (let* ((capability-command (plist-get parameters :capability-command))
+ (eo-capa (plist-get parameters :end-of-capability))
+ (eoc (plist-get parameters :end-of-command))
+ (start (point buffer))
+ (stream (let ((process-connection-type nil))
+ (start-process name buffer shell-file-name
+ shell-command-switch
+ (format-spec
+ (plist-get parameters :shell-command)
+ (format-spec-make
+ ?s host
+ ?p service))))))
+ (list stream
+ (network-stream-get-response stream start eoc)
+ (network-stream-command stream capability-command (or eo-capa eoc))
+ 'plain)))
+
+(defun open-network-stream (name buffer host service &rest parameters)
"Open a TCP connection for a service to a host.
-Return a process object to represent the connection.
+Normally, return a process object to represent the connection. If the
+:return-list parameter is non-NIL, instead return a list; see below.
Input and output work as for subprocesses; `delete-process' closes it.
NAME is name for process. It is modified if necessary to make it unique.
BUFFER is the buffer (or buffer-name) to associate with the process.
@@ -284,9 +444,64 @@
Third arg is name of the host to connect to, or its IP address.
Fourth arg SERVICE is name of the service desired, or an integer
specifying a port number to connect to.
-Fifth argument PROTOCOL is a network protocol. Currently 'tcp
- (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
- supported. When omitted, 'tcp is assumed.
+
+The remaining PARAMETERS should be a sequence of keywords and values:
+-:protocol is a network protocol. Currently 'tcp (Transmission Control
+ Protocol) and 'udp (User Datagram Protocol) are supported. When
+ omitted, 'tcp is assumed.
+-:type specifies the connection type; it is one of the following:
+ nil or `network': begin with an ordinary network connection, and if
+ the parameters :success and :capability-command are also
+ supplied, try to upgrade to an encrypted connection via
+ STARTTLS. If that fails (e.g., HOST does not support TLS),
+ retain an unencrypted connection.
+ `plain': an ordinary, unencrypted network connection.
+ `starttls': begin with an ordinary network connection and try to
+ upgrade via STARTTLS. If that fails, drop the connection
+ and return a killed process object.
+ `tls': a TLS connection.
+ `ssl': a synonym for `tls'.
+ `shell': a shell connection.
+-:return-list specifies this function's return value.
+ If omitted or nil, return a process object as usual. Otherwise, return
+ (PROC . PROPS), where PROC is a process object and PROPS is a plist of
+ connection properties, with these keywords:
+:greeting: the greeting returned by HOST (a string), or nil.
+:capabilities: a string representing HOST's capabilities, or nil if none
+ could be found.
+:type: the resulting connection type, `plain' (unencrypted) or `tls'
+ (encrypted).
+-:end-of-command specifies a regexp matching the end of a command.
+-:end-of-capability specifies a regexp matching the end of the response
+ to the command specified for :capability-command. It defaults to the
+ regexp specified for :end-of-command.
+-:success specifies a regexp matching a message indicating a successful
+ STARTTLS negotiation. For example, the default should be \"^3\" for an
+ NNTP connection.
+-:capability-command specifies a command used to query HOST for its
+ capabilities. For example, this should be \"1 CAPABILITY\\r\\n\" for
+ IMAP.
+-:starttls-function specifies a function for handling STARTTLS. This
+ function should take one parameter, the response to the capability
+ command, and should return the command to switch on STARTTLS if the
+ server supports it, or nil otherwise.
+-:always-query-capabilities, if non-nil, indicates that the server should
+ be queried for capabilities even if constructing a `plain' network
+ connection.
+-:client-certificate is either a list (certificate-key-filename
+ certificate-filename), or `t', meaning that `auth-source' will be
+ queried for the key and certificate. This parameter is used only when
+ constructing a TLS or STARTTLS connection.
+-:use-starttls-if-possible, if non-nil, indicates that STARTTLS should
+ be used even if TLS support is not compiled in to XEmacs.
+-:nogreeting, if non-nil, indicates that we should not wait for a
+ greeting from the server.
+-:nowait, if non-nil, indicates that an asynchronous connection should be
+ made, if possible. NOTE: this is currently unimplemented.
+
+For backwards compatibility, if exactly five arguments are given, the fifth
+must be one of nil, 'tcp, or 'udp. Both nil and 'tcp select TCP (Transmission
+Control Protocol) and 'udp selects UDP (User Datagram Protocol).
Output via `process-send-string' and input via buffer or filter (see
`set-process-filter') are stream-oriented. That means UDP datagrams are
@@ -315,6 +530,8 @@
You can change the coding systems later on using
`set-process-coding-system', `set-process-input-coding-system', or
`set-process-output-coding-system'."
+ (when (and (car parameters) (not (cdr parameters)))
+ (setq parameters (list :protocol (car parameters))))
(let (cs-r cs-w)
(let (ret)
(catch 'found
@@ -351,8 +568,44 @@
(coding-system-for-write
(or coding-system-for-write cs-w
(cdr default-network-coding-system)
- 'raw-text)))
- (open-network-stream-internal name buffer host service protocol))))
+ 'raw-text))
+ (type (plist-get parameters :type))
+ (return-list (plist-get parameters :return-list))
+ (capability-command (plist-get parameters :capability-command)))
+ (if (and (not return-list)
+ (or (eq type 'plain)
+ (and (or (null type) (eq type 'network))
+ (not (and (plist-get parameters :success)
+ capability-command)))))
+ ;; The simplest case: a plain connection
+ (open-network-stream-internal name buffer host service
+ (plist-get parameters :protocol))
+ (let ((work-buffer (or buffer
+ (generate-new-buffer " *stream buffer*")))
+ (fun (cond ((and (eq type 'plain)
+ (not (plist-get parameters
+ :always-query-capabilities)))
+ #'network-stream-open-plain)
+ ((memq type '(nil network starttls plain))
+ #'network-stream-open-starttls)
+ ((memq type '(tls ssl)) #'network-stream-open-tls)
+ ((eq type 'shell) 'network-stream-open-shell)
+ (t (error "Invalid connection type" type))))
+ result)
+ (unwind-protect
+ (setq result
+ (funcall fun name work-buffer host service parameters))
+ (unless buffer
+ (and (processp (car result))
+ (set-process-buffer (car result) nil))
+ (kill-buffer work-buffer)))
+ (if return-list
+ (list (car result)
+ :greeting (nth 1 result)
+ :capabilities (nth 2 result)
+ :type (nth 3 result)
+ :error (nth 4 result))
+ (car result)))))))
(defun set-buffer-process-coding-system (decoding encoding)
"Set coding systems for the process associated with the current buffer.
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,45 @@
+2014-10-07 Jerry James <james(a)xemacs.org>
+
+ * Makefile.in.in: Add tls.o to the link.
+ * config.h.in: Add TLS symbols (WITH_TLS, etc.).
+ * emacs.c (main_1): Call new functions in tls.c.
+ * events.h (STREAM_USE_TLS): New macro.
+ * lisp.h (Ffill): Export for nss_pk11_password.
+ * lstream.c (Lstream_tls_p): New function.
+ (Lstream_tls_negotiate): New function.
+ (struct filedesc_stream): Add tls_state member.
+ (make_filedesc_stream_1): Add state parameter. Use tls_get_fd.
+ (make_filedesc_input_stream): Add state parameter.
+ (make_filedesc_output_stream): Ditto.
+ (filedesc_reader): Use tls_read if tls_state is non-null.
+ (filedesc_writer): Use tls_write if tls_state is non-null.
+ (filedesc_closer): Use tls_close if tls_state is non-null.
+ (filedesc_tls_p): New function.
+ (fildesc_tls_negotiater): New function.
+ * lstream.h (Lstream_implementation): Add tls_p and tls_negotiater
+ members.
+ * process-nt.c (nt_open_network_stream): Add tls parameter.
+ * process-unix.c (unix_open_network_stream): Ditto. Call TLS
+ functions to set up the socket, if requested.
+ * process.c (tls_connection_p): New function.
+ (print_process): Use it.
+ (Fopen_network_stream_internal): Add optional tls argument.
+ (Ftls_negotiate): New function.
+ * tls.c: New file, with NSS, gnutls, and OpenSSL implementations.
+ * tls.h: New file.
+
+ * console-tty.c (tty_init_console):
+ * doc.c (extract_object_file_name):
+ (unparesseuxify_doc_string):
+ * event-stream.c (Fopen_dribble_file):
+ * event-unixoid.c (event_stream_unixoid_create_io_streams):
+ * file-coding.c (Ffind_coding_system_magic_cookie_in_file):
+ * fileio.c (Finsert_file_contents_internal):
+ (Fwrite_region_internal):
+ * gpmevent.c (tty_get_foreign_selection):
+ * lread.c (Fload_internal): Supply new tls arg to
+ make_filedesc_input_stream and make_filedesc_output_stream.
+
2014-09-30 Marcus Crestani <crestani(a)informatik.uni-tuebingen.de>
* editfns.c (Fencode_time): Switch signs when calculating the time
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/Makefile.in.in
--- a/src/Makefile.in.in
+++ b/src/Makefile.in.in
@@ -296,8 +296,8 @@
rangetab.o realpath.o redisplay.o redisplay-output.o regex.o\
search.o select.o sequence.o $(sheap_objs) $(shlib_objs) signal.o sound.o\
specifier.o strftime.o $(sunpro_objs) symbols.o syntax.o sysdep.o\
- text.o $(tooltalk_objs) $(tty_objs) undo.o unicode.o $(x_objs) $(x_gui_objs)\
- widget.o window.o $(win32_objs)
+ text.o tls.o $(tooltalk_objs) $(tty_objs) undo.o unicode.o \
+ $(x_objs) $(x_gui_objs) widget.o window.o $(win32_objs)
obj_rtl = $(objs:.o=.c.rtl)
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/config.h.in
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -499,6 +499,15 @@
/* Compile in support for SOCKS? */
#undef HAVE_SOCKS
+/* Compile in support for TLS */
+#undef WITH_TLS
+#undef HAVE_NSS
+#undef HAVE_GNUTLS
+#undef HAVE_GNUTLS_CERTIFICATE_VERIFICATION_STATUS_PRINT
+#undef HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS3
+#undef HAVE_OPENSSL
+#undef HAVE_X509_CHECK_HOST
+
/* Compile in support for X pixmaps via the `xpm' library? */
#undef HAVE_XPM
#undef FOR_MSW
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/console-tty.c
--- a/src/console-tty.c
+++ b/src/console-tty.c
@@ -137,7 +137,8 @@
}
/* set_descriptor_non_blocking (tty_con->infd); */
- tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0);
+ tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0,
+ NULL);
Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0);
tty_con->instream =
make_coding_input_stream (XLSTREAM (tty_con->instream),
@@ -145,7 +146,8 @@
CODING_DECODE,
LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME);
Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0);
- tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0);
+ tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0,
+ NULL);
tty_con->outstream =
make_coding_output_stream (XLSTREAM (tty_con->outstream),
get_coding_system_for_text_file (Qterminal, 0),
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/doc.c
--- a/src/doc.c
+++ b/src/doc.c
@@ -72,7 +72,7 @@
goto done;
}
- fdstream = make_filedesc_input_stream (fd, 0, -1, 0);
+ fdstream = make_filedesc_input_stream (fd, 0, -1, 0, NULL);
Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0);
instream =
make_coding_input_stream
@@ -187,7 +187,7 @@
goto done;
}
- fdstream = make_filedesc_input_stream (fd, 0, -1, 0);
+ fdstream = make_filedesc_input_stream (fd, 0, -1, 0, NULL);
Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0);
instream =
make_coding_input_stream
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/emacs.c
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -437,6 +437,7 @@
#include "sysfile.h"
#include "systime.h"
#include "sysproc.h" /* for qxe_getpid() */
+#include "tls.h"
#ifdef QUANTIFY
#include <quantify.h>
@@ -1605,6 +1606,7 @@
syms_of_scrollbar ();
#endif
syms_of_text ();
+ syms_of_tls ();
#ifdef HAVE_TOOLBARS
syms_of_toolbar ();
#endif
@@ -2215,6 +2217,7 @@
vars_of_symbols ();
vars_of_syntax ();
vars_of_text ();
+ vars_of_tls ();
#ifdef HAVE_TOOLBARS
vars_of_toolbar ();
#endif
@@ -2677,6 +2680,8 @@
init_device_tty ();
#endif
init_console_stream (restart); /* Create the first console */
+ if (initialized && !restart)
+ init_tls ();
/* try to get the actual pathname of the exec file we are running */
if (!restart)
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/event-stream.c
--- a/src/event-stream.c
+++ b/src/event-stream.c
@@ -4862,7 +4862,8 @@
CREAT_MODE);
if (fd < 0)
report_file_error ("Unable to create dribble file", filename);
- Vdribble_file = make_filedesc_output_stream (fd, 0, 0, LSTR_CLOSING);
+ Vdribble_file = make_filedesc_output_stream (fd, 0, 0, LSTR_CLOSING,
+ NULL);
#ifdef MULE
Vdribble_file =
make_coding_output_stream
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/event-unixoid.c
--- a/src/event-unixoid.c
+++ b/src/event-unixoid.c
@@ -357,6 +357,7 @@
USID* err_usid,
int flags)
{
+ tls_state_t *tls_state;
int infd, outfd, errfd;
/* Decode inhandle and outhandle. Their meaning depends on
the process implementation being used. */
@@ -366,17 +367,22 @@
outfd = (EMACS_INT) outhandle;
errfd = (EMACS_INT) errhandle;
+ tls_state = (flags & STREAM_USE_TLS) ? (tls_state_t *) inhandle : NULL;
+
*instream = (infd >= 0
- ? make_filedesc_input_stream (infd, 0, -1, 0)
+ ? make_filedesc_input_stream (infd, 0, -1,
+ tls_state ? LSTR_BLOCKED_OK : 0,
+ tls_state)
: Qnil);
*outstream = (outfd >= 0
- ? make_filedesc_output_stream (outfd, 0, -1, LSTR_BLOCKED_OK)
+ ? make_filedesc_output_stream (outfd, 0, -1, LSTR_BLOCKED_OK,
+ tls_state)
: Qnil);
*errstream = (errfd >= 0
- ? make_filedesc_input_stream (errfd, 0, -1, 0)
- : Qnil);
+ ? make_filedesc_input_stream (errfd, 0, -1, 0, tls_state)
+ : Qnil);
/* FLAGS is process->pty_flag for UNIX_PROCESSES */
if ((flags & STREAM_PTY_FLUSHING) && outfd >= 0)
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/events.h
--- a/src/events.h
+++ b/src/events.h
@@ -72,6 +72,7 @@
/* Flags for create_io_streams_cb() FLAGS parameter */
#define STREAM_PTY_FLUSHING 0x0001
#define STREAM_NETWORK_CONNECTION 0x0002
+#define STREAM_USE_TLS 0x0004
extern struct event_stream *event_stream;
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/file-coding.c
--- a/src/file-coding.c
+++ b/src/file-coding.c
@@ -4342,7 +4342,7 @@
goto badopen;
}
- lstream = make_filedesc_input_stream (fd, 0, -1, 0);
+ lstream = make_filedesc_input_stream (fd, 0, -1, 0, NULL);
Lstream_set_buffering (XLSTREAM (lstream), LSTREAM_UNBUFFERED, 0);
nread = Lstream_read (XLSTREAM (lstream), buf, sizeof (buf));
err = Lstream_errno (XLSTREAM (lstream));
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3177,7 +3177,7 @@
Charbpos cur_point = BUF_PT (buf);
struct gcpro ngcpro1;
Lisp_Object stream = make_filedesc_input_stream (fd, 0, total,
- LSTR_ALLOW_QUIT);
+ LSTR_ALLOW_QUIT, NULL);
Charcount last_tell = -1;
NGCPRO1 (stream);
@@ -3516,7 +3516,7 @@
that need to be made, and there could be a large latency
for each request. So I've increased the buffer size
to 64K.) */
- outstream = make_filedesc_output_stream (desc, 0, -1, 0);
+ outstream = make_filedesc_output_stream (desc, 0, -1, 0, NULL);
Lstream_set_buffering (XLSTREAM (outstream),
LSTREAM_BLOCKN_BUFFERED, 65536);
outstream =
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/gpmevent.c
--- a/src/gpmevent.c
+++ b/src/gpmevent.c
@@ -244,7 +244,8 @@
** done.
*/
output_stream = make_resizing_buffer_output_stream ();
- terminal_stream = make_filedesc_input_stream (fd, 0, -1, LSTR_BLOCKED_OK);
+ terminal_stream = make_filedesc_input_stream (fd, 0, -1, LSTR_BLOCKED_OK,
+ NULL);
output_string = Qnil;
/* #### We should arguably use a specbind() and an unwind routine here,
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5768,6 +5768,8 @@
Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object);
extern Fixnum warn_about_possibly_incompatible_back_references;
+/* Defined in sequence.c */
+EXFUN (Ffill, MANY);
/* Defined in signal.c */
void init_interrupts_late (void);
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/lread.c
--- a/src/lread.c
+++ b/src/lread.c
@@ -714,7 +714,7 @@
struct gcpro ngcpro1;
NGCPRO1 (lispstream);
- lispstream = make_filedesc_input_stream (fd, 0, -1, LSTR_CLOSING);
+ lispstream = make_filedesc_input_stream (fd, 0, -1, LSTR_CLOSING, NULL);
/* 64K is used for normal files; 8K should be OK here because Lisp
files aren't really all that big. */
Lstream_set_buffering (XLSTREAM (lispstream), LSTREAM_BLOCKN_BUFFERED,
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/lstream.c
--- a/src/lstream.c
+++ b/src/lstream.c
@@ -28,6 +28,7 @@
#include "buffer.h"
#include "insdel.h"
#include "lstream.h"
+#include "tls.h"
#include "sysfile.h"
@@ -990,6 +991,25 @@
Lstream_unread (lstr, &ch, 1);
}
+/* Detect an active TLS session */
+
+int
+Lstream_tls_p (Lstream *lstr)
+{
+ return (lstr->imp->tls_p) ? (lstr->imp->tls_p) (lstr) : 0;
+}
+
+/* STARTTLS negotiation */
+
+int
+Lstream_tls_negotiate (Lstream *instr, Lstream *outstr, const Extbyte *host,
+ Lisp_Object keylist)
+{
+ return (instr->imp->tls_negotiater)
+ ? (instr->imp->tls_negotiater) (instr, outstr, host, keylist)
+: 0;
+}
+
/************************ some stream implementations *********************/
@@ -1117,6 +1137,7 @@
struct filedesc_stream
{
+ tls_state_t *tls_state;
int fd;
int pty_max_bytes;
Ibyte eof_char;
@@ -1142,11 +1163,12 @@
ignored when writing); -1 for unlimited. */
static Lisp_Object
make_filedesc_stream_1 (int filedesc, int offset, int count, int flags,
- const char *mode)
+ tls_state_t *state, const char *mode)
{
Lstream *lstr = Lstream_new (lstream_filedesc, mode);
struct filedesc_stream *fstr = FILEDESC_STREAM_DATA (lstr);
- fstr->fd = filedesc;
+ fstr->tls_state = state;
+ fstr->fd = state ? tls_get_fd (state) : filedesc;
fstr->closing = !!(flags & LSTR_CLOSING);
fstr->allow_quit = !!(flags & LSTR_ALLOW_QUIT);
fstr->blocked_ok = !!(flags & LSTR_BLOCKED_OK);
@@ -1154,7 +1176,7 @@
fstr->blocking_error_p = 0;
fstr->chars_sans_newline = 0;
fstr->saved_errno = 0;
- fstr->starting_pos = lseek (filedesc, offset, SEEK_CUR);
+ fstr->starting_pos = lseek (fstr->fd, offset, SEEK_CUR);
fstr->current_pos = max (fstr->starting_pos, 0);
if (count < 0)
fstr->end_pos = -1;
@@ -1184,15 +1206,17 @@
*/
Lisp_Object
-make_filedesc_input_stream (int filedesc, int offset, int count, int flags)
+make_filedesc_input_stream (int filedesc, int offset, int count, int flags,
+ tls_state_t *state)
{
- return make_filedesc_stream_1 (filedesc, offset, count, flags, "r");
+ return make_filedesc_stream_1 (filedesc, offset, count, flags, state, "r");
}
Lisp_Object
-make_filedesc_output_stream (int filedesc, int offset, int count, int flags)
+make_filedesc_output_stream (int filedesc, int offset, int count, int flags,
+ tls_state_t *state)
{
- return make_filedesc_stream_1 (filedesc, offset, count, flags, "w");
+ return make_filedesc_stream_1 (filedesc, offset, count, flags, state, "w");
}
static Bytecount
@@ -1203,9 +1227,11 @@
str->saved_errno = 0;
if (str->end_pos >= 0)
size = min (size, (Bytecount) (str->end_pos - str->current_pos));
- nread = str->allow_quit ?
- read_allowing_quit (str->fd, data, size) :
- retry_read (str->fd, data, size);
+ nread = str->tls_state
+ ? tls_read (str->tls_state, data, size, str->allow_quit)
+: (str->allow_quit ?
+ read_allowing_quit (str->fd, data, size) :
+ retry_read (str->fd, data, size));
if (nread > 0)
str->current_pos += nread;
if (nread == 0)
@@ -1268,9 +1294,11 @@
/**** start of non-PTY-crap ****/
if (size > 0)
- retval = str->allow_quit ?
- write_allowing_quit (str->fd, data, size) :
- retry_write (str->fd, data, size);
+ retval = str->tls_state
+ ? tls_write (str->tls_state, data, size, str->allow_quit)
+: (str->allow_quit ?
+ write_allowing_quit (str->fd, data, size) :
+ retry_write (str->fd, data, size));
else
retval = 0;
if (retval < 0 && errno_would_block_p (errno) && str->blocked_ok)
@@ -1409,7 +1437,9 @@
filedesc_closer (Lstream *stream)
{
struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream);
- if (str->closing)
+ if (str->tls_state)
+ return tls_close (str->tls_state);
+ else if (str->closing)
return retry_close (str->fd);
else
return 0;
@@ -1439,6 +1469,32 @@
return str->fd;
}
+static int
+filedesc_tls_p (Lstream *stream)
+{
+ struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream);
+ return str->tls_state != NULL;
+}
+
+static int
+filedesc_tls_negotiater (Lstream *instream, Lstream *outstream,
+ const Extbyte *host, Lisp_Object keylist)
+{
+ struct filedesc_stream *in_str, *out_str;
+
+ if (!LSTREAM_TYPE_P (outstream, filedesc))
+ invalid_argument ("STARTTLS applies to file descriptor streams only",
+ wrap_lstream (outstream));
+
+ in_str = FILEDESC_STREAM_DATA (instream);
+ out_str = FILEDESC_STREAM_DATA (outstream);
+ in_str->tls_state = out_str->tls_state =
+ tls_negotiate (out_str->fd, host, keylist);
+ if (out_str->tls_state != NULL)
+ in_str->fd = out_str->fd = tls_get_fd (out_str->tls_state);
+ return out_str->tls_state != NULL;
+}
+
/*********** read from a Lisp string ***********/
#define LISP_STRING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, lisp_string)
@@ -1961,6 +2017,8 @@
LSTREAM_HAS_METHOD (filedesc, rewinder);
LSTREAM_HAS_METHOD (filedesc, seekable_p);
LSTREAM_HAS_METHOD (filedesc, closer);
+ LSTREAM_HAS_METHOD (filedesc, tls_p);
+ LSTREAM_HAS_METHOD (filedesc, tls_negotiater);
LSTREAM_HAS_METHOD (lisp_string, reader);
LSTREAM_HAS_METHOD (lisp_string, rewinder);
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/lstream.h
--- a/src/lstream.h
+++ b/src/lstream.h
@@ -24,6 +24,8 @@
#ifndef INCLUDED_lstream_h_
#define INCLUDED_lstream_h_
+#include "tls.h"
+
/************************************************************************/
/* definition of Lstream object */
/************************************************************************/
@@ -208,6 +210,12 @@
/* Mark this object for garbage collection. Same semantics as
a standard Lisp_Object marker. This function can be NULL. */
Lisp_Object (*marker) (Lisp_Object lstream);
+ /* Return nonzero if this stream is using a TLS connection */
+ int (*tls_p) (Lstream *stream);
+ /* Perform STARTTLS negotiation on a pair of streams, one for input and one
+ for output. Both are transformed if negotiation is successful. */
+ int (*tls_negotiater) (Lstream *instream, Lstream *outstream,
+ const Extbyte *host, Lisp_Object keylist);
} Lstream_implementation;
#define DEFINE_LSTREAM_IMPLEMENTATION(name, c_name) \
@@ -318,6 +326,10 @@
int Lstream_close (Lstream *lstr);
int Lstream_close_noflush (Lstream *lstr);
+int Lstream_tls_p (Lstream *lstr);
+int Lstream_tls_negotiate (Lstream *instr, Lstream *outstr,
+ const Extbyte *host, Lisp_Object keylist);
+
void Lstream_delete (Lstream *lstr);
void Lstream_set_character_mode (Lstream *str);
void Lstream_unset_character_mode (Lstream *lstr);
@@ -464,9 +476,9 @@
Lisp_Object make_stdio_input_stream (FILE *stream, int flags);
Lisp_Object make_stdio_output_stream (FILE *stream, int flags);
Lisp_Object make_filedesc_input_stream (int filedesc, int offset, int count,
- int flags);
+ int flags, tls_state_t *state);
Lisp_Object make_filedesc_output_stream (int filedesc, int offset, int count,
- int flags);
+ int flags, tls_state_t *state);
void filedesc_stream_set_pty_flushing (Lstream *stream,
int pty_max_bytes,
Ibyte eof_char);
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/process-nt.c
--- a/src/process-nt.c
+++ b/src/process-nt.c
@@ -1324,7 +1324,8 @@
static void
nt_open_network_stream (Lisp_Object name, Lisp_Object host,
Lisp_Object service,
- Lisp_Object protocol, void **vinfd, void **voutfd)
+ Lisp_Object protocol, void **vinfd, void **voutfd,
+ Boolint tls)
{
struct sockaddr_in address;
SOCKET s;
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/process-unix.c
--- a/src/process-unix.c
+++ b/src/process-unix.c
@@ -43,6 +43,7 @@
#include "sysdep.h"
#include "window.h"
#include "file-coding.h"
+#include "tls.h"
#include <setjmp.h>
#include "sysdir.h"
@@ -1857,10 +1858,12 @@
static void
unix_open_network_stream (Lisp_Object name, Lisp_Object host,
Lisp_Object service, Lisp_Object protocol,
- void **vinfd, void **voutfd)
+ void **vinfd, void **voutfd, Boolint tls)
{
EMACS_INT inch;
EMACS_INT outch;
+ tls_state_t *tls_state = NULL;
+ Extbyte *ext_host = NULL;
volatile int s = -1;
volatile int port;
volatile int retry = 0;
@@ -1869,6 +1872,7 @@
int retval;
CHECK_STRING (host);
+ ext_host = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
if (!EQ (protocol, Qtcp) && !EQ (protocol, Qudp))
invalid_constant ("Unsupported protocol", protocol);
@@ -1879,7 +1883,6 @@
struct addrinfo hints, *res;
struct addrinfo * volatile lres;
Extbyte *portstring;
- Extbyte *ext_host;
Extbyte portbuf[128];
/*
* Caution: service can either be a string or int.
@@ -1907,7 +1910,6 @@
else /* EQ (protocol, Qudp) */
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = 0;
- ext_host = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
retval = getaddrinfo (ext_host, portstring, &hints, &res);
if (retval != 0)
{
@@ -1960,16 +1962,19 @@
int family = address.sin_family;
#endif
- if (EQ (protocol, Qtcp))
- s = socket (family, SOCK_STREAM, 0);
- else /* EQ (protocol, Qudp) */
- s = socket (family, SOCK_DGRAM, 0);
+ if (!tls || TLS_SETUP_SOCK)
+ {
+ if (EQ (protocol, Qtcp))
+ s = socket (family, SOCK_STREAM, 0);
+ else /* EQ (protocol, Qudp) */
+ s = socket (family, SOCK_DGRAM, 0);
- if (s < 0)
- {
- xerrno = errno;
- failed_connect = 0;
- continue;
+ if (s < 0)
+ {
+ xerrno = errno;
+ failed_connect = 0;
+ continue;
+ }
}
loop:
@@ -1988,10 +1993,20 @@
can_break_system_calls = 1;
#ifdef USE_GETADDRINFO
- retval = connect (s, lres->ai_addr, lres->ai_addrlen);
+ retval = (!tls || TLS_SETUP_SOCK)
+ ? connect (s, lres->ai_addr, lres->ai_addrlen)
+ : 0;
#else
- retval = connect (s, (struct sockaddr *) &address, sizeof (address));
+ retval = (!tls || TLS_SETUP_SOCK)
+ ? connect (s, (struct sockaddr *) &address, sizeof (address))
+ : 0;
#endif
+ if (retval == 0 && tls)
+ {
+ tls_state = tls_open (s, ext_host);
+ retval = (tls_state == NULL) ? -1 : 0;
+ }
+
can_break_system_calls = 0;
if (retval == -1 && errno != EISCONN)
{
@@ -2020,8 +2035,11 @@
}
failed_connect = 1;
- retry_close (s);
- s = -1;
+ if (!tls || TLS_SETUP_SOCK)
+ {
+ retry_close (s);
+ s = -1;
+ }
continue;
}
@@ -2052,7 +2070,7 @@
freeaddrinfo (res);
#endif
- if (s < 0)
+ if ((!tls && s < 0) || (tls && tls_state == NULL))
{
errno = xerrno;
@@ -2064,6 +2082,14 @@
}
}
+ if (tls)
+ {
+ set_socket_nonblocking_maybe (tls_get_fd (tls_state), port, "tcp");
+ *vinfd = (void *) tls_state;
+ *voutfd = (void *) tls_state;
+ return;
+ }
+
inch = s;
outch = dup (s);
if (outch < 0)
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/process.c
--- a/src/process.c
+++ b/src/process.c
@@ -142,6 +142,15 @@
return Qnil;
}
+static int
+tls_connection_p (Lisp_Object process)
+{
+ Lisp_Process *p = XPROCESS (process);
+ Lstream *in = XLSTREAM (DATA_INSTREAM (p));
+ Lstream *out = XLSTREAM (DATA_OUTSTREAM (p));
+ return Lstream_tls_p (in) || Lstream_tls_p (out);
+}
+
static void
print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
@@ -157,9 +166,11 @@
else
{
int netp = network_connection_p (obj);
+ int tlsp = netp && tls_connection_p (obj);
write_ascstring (printcharfun,
- netp ? GETTEXT ("#<network connection ") :
- GETTEXT ("#<process "));
+ tlsp ? GETTEXT ("#<tls network connection ") :
+ (netp ? GETTEXT ("#<network connection ") :
+ GETTEXT ("#<process ")));
print_internal (process->name, printcharfun, 1);
write_ascstring (printcharfun, (netp ? " " : " pid "));
print_internal (process->pid, printcharfun, 1);
@@ -844,7 +855,7 @@
connection has no PID; you cannot signal it. All you can do is
deactivate and close it via delete-process */
-DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5,
+DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 6,
0, /*
Open a TCP connection for a service to a host.
Return a process object to represent the connection.
@@ -863,6 +874,9 @@
Optional fifth arg PROTOCOL is a network protocol. Currently only `tcp'
(Transmission Control Protocol) and `udp' (User Datagram Protocol) are
supported. When omitted, `tcp' is assumed.
+Optional sixth arg TLS is a boolean. If it is NIL, a standard network stream
+ is opened. If it is non-NIL, a TLS network stream is opened if TLS support
+ is available; otherwise an error is signaled.
Output via `process-send-string' and input via buffer or filter (see
`set-process-filter') are stream-oriented. That means UDP datagrams are
@@ -871,12 +885,13 @@
are usually fine.) Note further that the UDP protocol does not guard
against lost packets.
*/
- (name, buffer, host, service, protocol))
+ (name, buffer, host, service, protocol, tls))
{
/* This function can GC */
Lisp_Object process = Qnil;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, ngcpro1;
void *inch, *outch;
+ int flags;
GCPRO5 (name, buffer, host, service, protocol);
CHECK_STRING (name);
@@ -889,7 +904,7 @@
/* Since this code is inside HAVE_SOCKETS, existence of
open_network_stream is mandatory */
PROCMETH (open_network_stream, (name, host, service, protocol,
- &inch, &outch));
+ &inch, &outch, !NILP(tls)));
if (!NILP (buffer))
buffer = Fget_buffer_create (buffer);
@@ -898,9 +913,11 @@
XPROCESS (process)->pid = Fcons (service, host);
XPROCESS (process)->buffer = buffer;
+ flags = STREAM_NETWORK_CONNECTION;
+ if (!NILP (tls))
+ flags |= STREAM_USE_TLS;
init_process_io_handles (XPROCESS (process), (void *) inch, (void *) outch,
- (void *) -1,
- STREAM_NETWORK_CONNECTION);
+ (void *) -1, flags);
event_stream_select_process (XPROCESS (process), 1, 1);
@@ -909,6 +926,29 @@
return process;
}
+DEFUN ("tls-negotiate", Ftls_negotiate, 3, 3, 0, /*
+ "Negotiate a SSL/TLS connection. Returns PROCESS if negotiation is
+successful, NIL otherwise.
+
+PROCESS is a process returned by `open-network-stream'.
+HOSTNAME is the remote hostname. It must be a valid string.
+KEYLIST is an alist of (client key file, client cert file) pairs.
+*/
+ (process, hostname, keylist))
+{
+ Lisp_Process *p;
+ Lstream *in, *out;
+ Extbyte *ext_host;
+
+ CHECK_PROCESS (process);
+ CHECK_STRING (hostname);
+ p = XPROCESS (process);
+ in = XLSTREAM (DATA_INSTREAM (p));
+ out = XLSTREAM (DATA_OUTSTREAM (p));
+ ext_host = LISP_STRING_TO_EXTERNAL (hostname, Qunix_host_name_encoding);
+ return Lstream_tls_negotiate (in, out, ext_host, keylist) ? process : Qnil;
+}
+
#ifdef HAVE_MULTICAST
DEFUN ("open-multicast-group-internal", Fopen_multicast_group_internal, 5, 5, 0, /*
@@ -2601,6 +2641,7 @@
DEFSUBR (Fstart_process_internal);
#ifdef HAVE_SOCKETS
DEFSUBR (Fopen_network_stream_internal);
+ DEFSUBR (Ftls_negotiate);
#ifdef HAVE_MULTICAST
DEFSUBR (Fopen_multicast_group_internal);
#endif /* HAVE_MULTICAST */
diff -r 36dddf9d90d1c2b7fa2e60bb96c9f8bce365e924 -r a216b3c2b09e93494d82507ff5dd36e4d2474d16 src/procimpl.h
--- a/src/procimpl.h
+++ b/src/procimpl.h
@@ -49,7 +49,7 @@
#ifdef HAVE_SOCKETS
void (*open_network_stream) (Lisp_Object name, Lisp_Object host,
Lisp_Object service, Lisp_Object protocol,
- void** vinfd, void** voutfd);
+ void** vinfd, void** voutfd, Boolint tls);
#ifdef HAVE_MULTICAST
void (*open_multicast_group) (Lisp_Object name, Lisp_Object dest,
Lisp_Object port, Lisp_Object ttl,
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/auctex: Jerry James: Fix ignoring and cleaning of .elcs. See xemacs-patches message with ID
10 years, 2 months
Bitbucket
1 new commit in auctex:
https://bitbucket.org/xemacs/auctex/commits/28172a30aa13/
Changeset: 28172a30aa13
User: Jerry James
Date: 2014-10-03 18:20:13+00:00
Summary: Fix ignoring and cleaning of .elcs. See xemacs-patches message with ID
<CAHCOHQmQi0emR9Zww=tX__4WbXdh-BRx-2Y8zc7-VEtwEBgm4A(a)mail.gmail.com>.
Affected #: 3 files
diff -r 5b9406bf4cbf9ba4dbe1f5846ab9aba23c419fe2 -r 28172a30aa13a228caff3a4fac79a95c3f694e02 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,7 +1,6 @@
^#\..*#$
^\.#
~$
-\.elc$
\.html$
\.info$
^_pkg\.el$
@@ -12,6 +11,7 @@
^auto-autoloads\.el$
^custom-defines\.el$
^custom-load\.el$
+^etc/.*\.elc$
^package-info$
^pdepends\.mk$
^texi/tex-ref\.dvi$
diff -r 5b9406bf4cbf9ba4dbe1f5846ab9aba23c419fe2 -r 28172a30aa13a228caff3a4fac79a95c3f694e02 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * .hgignore: Ignore .elcs in etc.
+ * Makefile (clean): Remove .elcs from etc.
+
2014-07-05 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.53 released.
diff -r 5b9406bf4cbf9ba4dbe1f5846ab9aba23c419fe2 -r 28172a30aa13a228caff3a4fac79a95c3f694e02 Makefile
--- a/Makefile
+++ b/Makefile
@@ -228,3 +228,6 @@
$(LATEX) '\nonstopmode \input preview.drv' && \
$(LATEX) '\nonstopmode \input preview.drv' && \
$(LATEX) '\nonstopmode \input preview.drv'
+
+clean::
+ @rm -f etc/*.elc
Repository URL: https://bitbucket.org/xemacs/auctex/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[AC packages] Drop 21.1 support (latin-unity and mule-ucs)
10 years, 2 months
Jerry James
APPROVE COMMIT packages
On Mon, Sep 29, 2014 at 9:51 PM, Jerry James <james(a)xemacs.org> wrote:
> PATCH packages
>
> The latin-unity and mule-ucs packages are both unique, in exactly the same
> way. "You keep using that word. I do not think it means what you think it
> means." They both fail to byte compile successfully with 21.1. At this
> point, I do not believe that we care. This patch removes the Makefile bits
> that deal with 21.1 from those two packages.
>
> Speaking of words that don't mean what you think they mean, "support" isn't
> really the right word, but I'm not sure how else to phrase it.
I have committed this patch.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/mule-ucs: Jerry James: Drop 21.1 support. See xemacs-patches message with ID
10 years, 2 months
Bitbucket
1 new commit in mule-ucs:
https://bitbucket.org/xemacs/mule-ucs/commits/9bf5aa4fe2ab/
Changeset: 9bf5aa4fe2ab
User: Jerry James
Date: 2014-10-03 18:18:17+00:00
Summary: Drop 21.1 support. See xemacs-patches message with ID
<CAHCOHQ=UnNnZpQk3KOQpRApyk5uzWkenmxaaZdzYtA2+dfKdZw(a)mail.gmail.com>.
Affected #: 2 files
diff -r f7fb28ff013e12e7d94db7caae862dcff4c2dc16 -r 9bf5aa4fe2ab844e5eb9e0de5878fddb60bf1121 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * Makefile: Drop XEmacs 21.1 support.
+
2014-05-15 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.20 released.
diff -r f7fb28ff013e12e7d94db7caae862dcff4c2dc16 -r 9bf5aa4fe2ab844e5eb9e0de5878fddb60bf1121 Makefile
--- a/Makefile
+++ b/Makefile
@@ -25,15 +25,6 @@
REQUIRES = mule-base latin-euro-standards
CATEGORY = mule
-# Mule-UCS is a unique package in that it does not compile or run
-# under XEmacsen 21.1, at least not "out of the box". So here's
-# some really ugly Makefile voodoo that will allow people using XEmacs
-# 21.1 to build the packages without it blowing up in their faces.
-# Don't try this at home, kids. SY.
-include ../../Local.rules
-CHECK_VERSION = $(XEMACS) -batch -no-autoloads -eval '(princ (emacs-version>= 21 4))'
-
-ifeq ($(shell $(CHECK_VERSION)),t)
EXTRA_SOURCES = \
lisp/un-trbase.el
@@ -82,15 +73,3 @@
#compile::
# $(XEMACS) -no-autoloads -batch -l mucs-comp.el
-
-else
-include ../../Version.rules
-
-bad-version:
- @echo "************************ W A R N I N G *************************"
- @echo "Building Mule-UCS with versions less than 21.4 is unsupported by"
- @echo "the XEmacs Project."
- @echo "If you need this feature, contact the package maintainer directly:"
- @echo "$(MAINTAINER)"
-endif
-
Repository URL: https://bitbucket.org/xemacs/mule-ucs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/latin-unity: Jerry James: Drop 21.1 support. See xemacs-patches message with ID
10 years, 2 months
Bitbucket
1 new commit in latin-unity:
https://bitbucket.org/xemacs/latin-unity/commits/c3d348f230f9/
Changeset: c3d348f230f9
User: Jerry James
Date: 2014-10-03 18:17:54+00:00
Summary: Drop 21.1 support. See xemacs-patches message with ID
<CAHCOHQ=UnNnZpQk3KOQpRApyk5uzWkenmxaaZdzYtA2+dfKdZw(a)mail.gmail.com>.
Affected #: 2 files
diff -r 0db6a485b423482b9deb61d0df8c459dfb5755d7 -r c3d348f230f98ee8f174c14b651a24d75323355f ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * Makefile: Drop XEmacs 21.1 support.
+
2014-05-15 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.22 released.
diff -r 0db6a485b423482b9deb61d0df8c459dfb5755d7 -r c3d348f230f98ee8f174c14b651a24d75323355f Makefile
--- a/Makefile
+++ b/Makefile
@@ -36,15 +36,6 @@
REQUIRES = mule-base latin-euro-standards mule-ucs leim fsf-compat dired
endif
-# Latin-Unity is a unique package in that it does not compile or run
-# under XEmacsen 21.1, at least not "out of the box". So here's
-# some really ugly Makefile voodoo that will allow people using XEmacs
-# 21.1 to build the packages without it blowing up in their faces.
-# Don't try this at home, kids. SY.
-include ../../Local.rules
-CHECK_VERSION = $(XEMACS) -batch -no-autoloads -eval '(princ (emacs-version>= 21 4))'
-
-ifeq ($(shell $(CHECK_VERSION)),t)
ELCS = latin-unity.elc latin-unity-vars.elc latin-euro-input.elc \
latin-unity-latin7.elc latin-latin7-input.elc latin-unity-latin9.elc \
latin-unity-latin8.elc latin-unity-latin10.elc \
@@ -86,14 +77,3 @@
# -l latin-unity-vars -l latin-unity \
# -f latin-unity-install -f latin-unity-test \
# -eval "(write-file \"./latintest\" nil 'iso-2022-7)"
-else
-include ../../Version.rules
-
-bad-version: autoloads
- @echo "************************ W A R N I N G *************************"
- @echo "Building $(PACKAGE) with versions less than 21.4 is unsupported by"
- @echo "the XEmacs Project."
- @echo "If you need this feature, contact the package maintainer directly:"
- @echo "$(MAINTAINER)"
-
-endif
Repository URL: https://bitbucket.org/xemacs/latin-unity/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[PATCH packages] Drop 21.1 support (latin-unity and mule-ucs)
10 years, 2 months
Jerry James
PATCH packages
The latin-unity and mule-ucs packages are both unique, in exactly the same
way. "You keep using that word. I do not think it means what you think it
means." They both fail to byte compile successfully with 21.1. At this
point, I do not believe that we care. This patch removes the Makefile bits
that deal with 21.1 from those two packages.
Speaking of words that don't mean what you think they mean, "support" isn't
really the right word, but I'm not sure how else to phrase it.
diff -r 0db6a485b423 mule-packages/latin-unity/ChangeLog
--- a/mule-packages/latin-unity/ChangeLog Thu May 15 20:53:40 2014 +0200
+++ b/mule-packages/latin-unity/ChangeLog Mon Sep 29 16:19:18 2014 -0600
@@ -1,3 +1,7 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * Makefile: Drop XEmacs 21.1 support.
+
2014-05-15 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.22 released.
diff -r 0db6a485b423 mule-packages/latin-unity/Makefile
--- a/mule-packages/latin-unity/Makefile Thu May 15 20:53:40 2014 +0200
+++ b/mule-packages/latin-unity/Makefile Mon Sep 29 16:19:18 2014 -0600
@@ -36,15 +36,6 @@
REQUIRES = mule-base latin-euro-standards mule-ucs leim fsf-compat dired
endif
-# Latin-Unity is a unique package in that it does not compile or run
-# under XEmacsen 21.1, at least not "out of the box". So here's
-# some really ugly Makefile voodoo that will allow people using XEmacs
-# 21.1 to build the packages without it blowing up in their faces.
-# Don't try this at home, kids. SY.
-include ../../Local.rules
-CHECK_VERSION = $(XEMACS) -batch -no-autoloads -eval '(princ
(emacs-version>= 21 4))'
-
-ifeq ($(shell $(CHECK_VERSION)),t)
ELCS = latin-unity.elc latin-unity-vars.elc latin-euro-input.elc \
latin-unity-latin7.elc latin-latin7-input.elc
latin-unity-latin9.elc \
latin-unity-latin8.elc latin-unity-latin10.elc \
@@ -86,14 +77,3 @@
# -l latin-unity-vars -l latin-unity \
# -f latin-unity-install -f latin-unity-test \
# -eval "(write-file \"./latintest\" nil 'iso-2022-7)"
-else
-include ../../Version.rules
-
-bad-version: autoloads
- @echo "************************ W A R N I N G *************************"
- @echo "Building $(PACKAGE) with versions less than 21.4 is unsupported by"
- @echo "the XEmacs Project."
- @echo "If you need this feature, contact the package maintainer directly:"
- @echo "$(MAINTAINER)"
-
-endif
diff -r f7fb28ff013e mule-packages/mule-ucs/ChangeLog
--- a/mule-packages/mule-ucs/ChangeLog Wed Jun 04 15:36:18 2014 -0600
+++ b/mule-packages/mule-ucs/ChangeLog Mon Sep 29 16:19:18 2014 -0600
@@ -1,3 +1,7 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * Makefile: Drop XEmacs 21.1 support.
+
2014-05-15 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.20 released.
diff -r f7fb28ff013e mule-packages/mule-ucs/Makefile
--- a/mule-packages/mule-ucs/Makefile Wed Jun 04 15:36:18 2014 -0600
+++ b/mule-packages/mule-ucs/Makefile Mon Sep 29 16:19:18 2014 -0600
@@ -25,15 +25,6 @@
REQUIRES = mule-base latin-euro-standards
CATEGORY = mule
-# Mule-UCS is a unique package in that it does not compile or run
-# under XEmacsen 21.1, at least not "out of the box". So here's
-# some really ugly Makefile voodoo that will allow people using XEmacs
-# 21.1 to build the packages without it blowing up in their faces.
-# Don't try this at home, kids. SY.
-include ../../Local.rules
-CHECK_VERSION = $(XEMACS) -batch -no-autoloads -eval '(princ
(emacs-version>= 21 4))'
-
-ifeq ($(shell $(CHECK_VERSION)),t)
EXTRA_SOURCES = \
lisp/un-trbase.el
@@ -82,15 +73,3 @@
#compile::
# $(XEMACS) -no-autoloads -batch -l mucs-comp.el
-
-else
-include ../../Version.rules
-
-bad-version:
- @echo "************************ W A R N I N G *************************"
- @echo "Building Mule-UCS with versions less than 21.4 is unsupported by"
- @echo "the XEmacs Project."
- @echo "If you need this feature, contact the package maintainer directly:"
- @echo "$(MAINTAINER)"
-endif
-
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/mule-base: Jerry James: Fix ethio-util compilation with 21.4. See xemacs-patches message with ID
10 years, 2 months
Bitbucket
1 new commit in mule-base:
https://bitbucket.org/xemacs/mule-base/commits/f2afeffa62f4/
Changeset: f2afeffa62f4
User: Jerry James
Date: 2014-10-03 18:13:15+00:00
Summary: Fix ethio-util compilation with 21.4. See xemacs-patches message with ID
<CAHCOHQnOeuyfB74M2U943DJwUro2pBsxwwbrYt2PMCagSfWhfQ(a)mail.gmail.com>.
Affected #: 2 files
diff -r bfa0cf1e094d020e959bd26ae59277d320edce3a -r f2afeffa62f49f7edaa6a16ccc623ee3561e7f34 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-29 Jerry James <james(a)xemacs.org>
+
+ * Makefile: Put ethio-util.el in EXTRA_SOURCES if building with
+ XEmacs 21.4, and ethio-util.elc in ELCS if XEmacs 21.5.
+
2014-06-22 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.59 released.
diff -r bfa0cf1e094d020e959bd26ae59277d320edce3a -r f2afeffa62f49f7edaa6a16ccc623ee3561e7f34 Makefile
--- a/Makefile
+++ b/Makefile
@@ -29,11 +29,15 @@
cyril-util.elc kana-keyboard.elc korea-util.elc isearch-mule.elc \
japan-util.elc mule-cne.elc mule-diag.elc mule-keyboard.elc \
mule-trex.elc mule-util.elc thai-xtis-util.elc viet-util.elc \
- ethio-util.elc fsf-compat-unicode.elc
+ fsf-compat-unicode.elc
+
+include ../../Local.rules
# The following are shipped unbytecompiled if built by XEmacs 21.4 or earlier
# because they aren't grokked by those versions.
ifeq ($(XEMACS_21_5),t)
+ELCS += ethio-util.elc
+else
EXTRA_SOURCES = ethio-util.el
endif
Repository URL: https://bitbucket.org/xemacs/mule-base/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches