summaryrefslogtreecommitdiff
path: root/guile
Commit message (Collapse)AuthorAgeFilesLines
* Drop guile bindings. See <https://gitlab.com/gnutls/guile/>.Simon Josefsson2022-10-2637-7450/+0
| | | | Signed-off-by: Simon Josefsson <simon@josefsson.org>
* guile: revert gnutls/build/tests.scm to use use-modulesDaiki Ueno2022-07-271-3/+4
| | | | | | | | This partially reverts e727eb7901a3f1754de970c8529925ae3d591b90. For some reason, the usage of #:use-module causes some behavioral difference that affects reauth.scm test. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* guile: Allow session record ports to have a 'close' procedure.Ludovic Courtès2022-07-183-9/+113
| | | | | | | | | | | | | | | | | | | | | | This addition makes it easy to close the backing file descriptor or port of a session when its record port is closed. * guile/src/core.c (SCM_GNUTLS_SESSION_RECORD_PORT_SESSION): Add SCM_CAR. (SCM_GNUTLS_SESSION_RECORD_PORT_CLOSE_PROCEDURE) (SCM_GNUTLS_SET_SESSION_RECORD_PORT_CLOSE) (SCM_GNUTLS_SESSION_RECORD_PORT_P) (SCM_VALIDATE_SESSION_RECORD_PORT): New macros. (make_session_record_port): Change "stream" argument to a pair. (close_session_record_port): New function. (scm_gnutls_session_record_port): Add optional 'close' parameter and honor it. (scm_gnutls_set_session_record_port_close_x): New function. (scm_init_gnutls_session_record_port_type): Add call to 'scm_set_port_close' and 'scm_set_port_needs_close_on_gc'. * guile/tests/session-record-port.scm: Test it. * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Remove support for the 1.8.x series.Ludovic Courtès2022-07-173-122/+45
| | | | | | | | | | | | | | | | | The last Guile 1.8.x release dates back to 2010. * configure.ac: Remove 1.8 from 'GUILE_PKG'. * doc/gnutls-guile.texi (Guile Preparations): Remove mention of Guile 1.8. * guile/src/core.c (mark_session_record_port) (free_session_record_port): Remove. (scm_init_gnutls_session_record_port_type): Remove corresponding 'scm_set_port_mark' and 'scm_set_port_free' calls. * guile/modules/gnutls.in: Remove top-level 'cond-expand' forms for Guile 1.8. * guile/modules/gnutls/build/tests.scm: Likewise. * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Session record port treats premature termination as EOF.Ludovic Courtès2022-07-103-4/+100
| | | | | | | | | | | * guile/src/core.c (do_fill_port) [USING_GUILE_BEFORE_2_2]: Treat GNUTLS_E_PREMATURE_TERMINATION as EOF. (read_from_session_record_port) [!USING_GUILE_BEFORE_2_2]: Likewise. * guile/tests/premature-termination.scm: New file. * guile/Makefile.am (TESTS): Add it. * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Add 'GNUTLS_DIG_SHA256' enum value.Simon South2021-08-223-2/+10
| | | | | | | | | | * guile/modules/gnutls/build/enums.scm (%digest-enum): Add 'sha256'. * guile/modules/gnutls.in: Export 'digest/sha256'. * guile/tests/x509-certificates.scm: Test 'digest/sha256' with 'x509-certificate-fingerprint'. (%sha256-fingerprint): New constant. Signed-off-by: Simon South <simon@simonsouth.net>
* guile: Add binding for 'gnutls_x509_crt_get_fingerprint'.Simon South2021-08-223-5/+57
| | | | | | | | | | | * guile/src/core.c (MAX_HASH_SIZE): New constant. (scm_gnutls_x509_certificate_fingerprint): New function. * guile/modules/gnutls.in: Export 'x509-certificate-fingerprint'. * guile/tests/x509-certificates.scm: Test 'x509-certificate-fingerprint'. (%sha1-fingerprint): New constant. (u8vector->hex-string): New procedure. Signed-off-by: Simon South <simon@simonsouth.net>
* guile: Writes to record ports handle EAGAIN/EINTR transparently.Ludovic Courtès2021-06-161-3/+16
| | | | | | | | | | | | | | | | Reported at <https://issues.guix.gnu.org/47867> by Florian Pelz <pelzflorian@pelzflorian.de>. This is a followup to a229bb36c9592b151f6feb277238c41ab39f40a9. * guile/src/core.c (write_to_session_record_port) [USING_GUILE_BEFORE_2_2]: Keep looping upon GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED. (write_to_session_record_port) [!USING_GUILE_BEFORE_2_2]: Loop on GNUTLS_E_INTERRUPTED and return -1 on GNUTLS_E_AGAIN if C_SESSION is backed by a file descriptor. * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Fix implicit conversion warningLeonardo Bras2021-05-211-1/+1
| | | | | | | | | | | | | | | | | When building, the following warning may be printing: CC guile_gnutls_v_2_la-utils.lo core.c: In function 'scm_gnutls_set_server_session_certificate_request_x': core.c:545:13: warning: implicit conversion from 'gnutls_certificate_request_t' to 'gnutls_certificate_status_t' [-Wenum-conversion] 545 | c_request = scm_to_gnutls_certificate_request (request, 2, FUNC_NAME); | ^ core.c:547:53: warning: implicit conversion from 'gnutls_certificate_status_t' to 'gnutls_certificate_request_t' [-Wenum-conversion] 547 | gnutls_certificate_server_set_request (c_session, c_request); | Fix this warning by changing c_request type to gnutls_certificate_request_t. Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
* guile: Tests show their PID upon uncaught exceptions.Ludovic Courtès2021-04-241-2/+3
| | | | | | | * guile/modules/gnutls/build/tests.scm (run-test): Display the PID when throwing an exception. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Avoid the deprecated 'scm_t_uint8' type.Ludovic Courtès2021-04-231-4/+4
| | | | | | | * guile/src/core.c: Use 'uint8_t' instead of 'scm_t_uint8', which is deprecated in Guile 3.0. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Avoid potentially missed reference.Ludovic Courtès2021-04-231-3/+5
| | | | | | | | | | | There's one case where 'register_weak_reference' is called several times on the same object, in 'set-certificate-credentials-x509-keys!', where PRIVKEY could have been GC'd before CRED. * guile/src/core.c (register_weak_reference): Add TO to the weak references of FROM instead of overriding them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Remove leftover comment about allocation routines.Ludovic Courtès2021-04-231-1/+0
| | | | | | | | This is a followup to 872409857351f28b1e3c21526bfa6606c918b176. * guile/src/core.c (scm_init_gnutls): Remove leftover comment. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Arrange to make 'gnutls.scm' architecture-independent.Ludovic Courtès2019-12-262-3/+8
| | | | | | | | | | | | Fixes #838. Reported by Andreas Metzler. * configure.ac: Define and substitute 'maybe_guileextensiondir'. * guile/Makefile.am (.in.scm): Substitute 'maybe_guileextensiondir'. * guile/modules/gnutls.in <top level>: Use @maybe_guileextensiondir@. Check if %LIBDIR is true. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Silence auto-compilation warning for 'guild'.Ludovic Courtès2019-11-111-1/+1
| | | | | | | | | | | Reported by Helmut Grohne <helmut@subdivi.de> and Andreas Metzler <ametzler@bebt.de> at <https://bugs.debian.org/943905>. * guile/Makefile.am (%.go): Pass "GUILE_AUTO_COMPILE=0" to avoid warnings about 'guild' needing to be compiled. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Do not attempt to load shared object when cross-compiling.Ludovic Courtès2019-11-112-2/+10
| | | | | | | | | | | | | | Reported by Helmut Grohne <helmut@subdivi.de> and Andreas Metzler <ametzler@bebt.de> at <https://bugs.debian.org/943905>. * configure.ac: Add 'CROSS_COMPILING' conditional. * guile/Makefile.am (CROSS_COMPILING_VARIABLE): New variable. (%.go): Use it. * guile/modules/gnutls.in <top level>: Do not call 'load-extension' when "GNUTLS_GUILE_CROSS_COMPILING" is defined. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Update the list of certificate status values.Ludovic Courtès2019-08-313-1/+30
| | | | | | | | | | * guile/modules/gnutls/build/enums.scm (%certificate-status-enum): Add 'gnutls_certificate_status_t' values that were missing. * guile/src/core.c (scm_gnutls_peer_certificate_status): Add 'MATCH_STATUS' clauses to handle them. * guile/modules/gnutls.in: Export them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Add support for post-handshake reauthentication.Ludovic Courtès2019-06-125-9/+199
| | | | | | | | | | | | | | | * guile/modules/gnutls/build/enums.scm (%connection-flag-enum): New variable. (%gnutls-enums): Add it. * guile/modules/gnutls.in: Export 'reauthenticate', 'connection-flag->string', and all the 'connection-flag/' bindings. * guile/src/core.c (scm_gnutls_make_session): Add rest arguments FLAGS and honor it. (scm_gnutls_reauthenticate): New function. * guile/tests/reauth.scm: New file. * guile/Makefile.am (TESTS): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Loop or poll upon GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED.Ludovic Courtès2019-06-121-5/+50
| | | | | | | | | | | | * guile/src/core.c (do_fill_port) [USING_GUILE_BEFORE_2_2]: Loop while 'gnutls_record_recv' returns GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED. (read_from_session_record_port) [!USING_GUILE_BEFORE_2_2]: Likewise, and return -1 if SCM_GNUTLS_SESSION_TRANSPORT_IS_FD and we got GNUTLS_E_AGAIN. (session_record_port_fd) [!USING_GUILE_BEFORE_2_2]: New function. (scm_init_gnutls_session_record_port_type) [!USING_GUILE_BEFORE_2_2]: Call 'scm_set_port_read_wait_fd'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Add bindings for 'gnutls_error_is_fatal'.Ludovic Courtès2019-06-123-12/+28
| | | | | | | | * guile/src/errors.c (scm_gnutls_fatal_error_p): New function. * guile/modules/gnutls.in: Export 'fatal-error?'. * guile/tests/errors.scm: test 'fatal-error?'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guile: Update list of error values.Ludovic Courtès2019-06-122-3/+131
| | | | | | | | * guile/modules/gnutls/build/enums.scm (%error-enum): Update list of error constants. * guile/modules/gnutls.in (gnutls): Adjust exports accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Merge branch 'guile-deprecate-openpgp' into 'master'Nikos Mavrogiannopoulos2019-06-122-13/+82
|\ | | | | | | | | guile: Deprecate OpenPGP bindings. See merge request gnutls/gnutls!1021
| * guile: Deprecate OpenPGP bindings.Ludovic Courtès2019-06-122-14/+83
| | | | | | | | | | | | | | | | * guile/modules/gnutls.in (define-deprecated): New macro. Use it for all the *openpgp* bindings. * guile/src/core.c: Rename *openpgp* bindings with a '%' prefix. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | guile: Remove unbounded uses of 'alloca'.Ludovic Courtès2019-06-072-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guile/src/core.c (ALLOCA_MAX_SIZE, FAST_ALLOC): New macros. (set_certificate_file): (scm_gnutls_set_certificate_credentials_x509_key_files_x) (scm_gnutls_set_srp_server_credentials_files_x) (scm_gnutls_set_srp_client_credentials_x) (scm_gnutls_srp_base64_encode, scm_gnutls_srp_base64_decode) (scm_gnutls_set_psk_server_credentials_file_x) (scm_gnutls_pkcs8_import_x509_private_key) (scm_gnutls_x509_certificate_matches_hostname_p) (scm_gnutls_import_openpgp_private_key): Use 'FAST_ALLOC' instead of 'alloca'. * guile/src/utils.c: Remove unneeded <alloca.h> include. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | guile: Always provide 'scm_gc_malloc_pointerless'.Ludovic Courtès2019-06-071-7/+7
|/ | | | | | | | * guile/src/core.c (scm_gc_malloc_pointerless) [!HAVE_SCM_GC_MALLOC_POINTERLESS]: New macro. (make_session_record_port): Remove #ifdef HAVE_SCM_GC_MALLOC_POINTERLESS. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* build: rename guile variables to match upstream namesAlon Bar-Lev2019-04-091-8/+8
| | | | | | Reduce confusion between the upstream terms and the gnutls terms. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* build: allow override guile system locationAlon Bar-Lev2019-04-091-2/+1
| | | | | | | | | | | | | | | | guile has three settings acquired from system: * GUILE_SITE * GUILE_SITE_CCACHE * GUILE_EXTENSION The <guile-2.2 m4 macro exposed only GUILE_SITE while build tried to guess the other variables based on the $libdir of the gnutls which may be different. The >=guile-2.2 m4 macro provides all settings for build to use as default, while allowing to override each. Resolves: #748 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Use https:// for arbitrary files #1Tim Rühsen2019-03-134-6/+6
| | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Fix unused var warning in guile/src/core.ctmp-fix-guile-unused-varTim Rühsen2019-01-251-4/+4
| | | | Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* Skip sc_prohibit_always_true_header_testsTim Rühsen2018-06-142-4/+0
| | | | | | | | | We can't simply remove the checks for HAVE_SYS_SOCKET_H. If we do, we have to make checks on real WIN32, which is currently not an option. So we skip sc_prohibit_always_true_header_tests. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
* tests: guile: don't use VERS-TLS-ALLNikos Mavrogiannopoulos2018-02-193-5/+5
| | | | | | That is, avoid enabling experimental protocols. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* guile: removed openpgp related testsNikos Mavrogiannopoulos2017-06-1610-415/+0
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* <alloca.h> only if HAVE_ALLOCA_HMarcin Cieślak2017-02-092-0/+4
| | | | | | FreeBSD does know alloca() but has no such header Signed-off-by: Marcin Cieślak <saper@SAPER.INFO>
* guile: do not use +COMP-DEFLATE in priorities testNikos Mavrogiannopoulos2016-11-291-1/+1
| | | | | This allows the test to work even in the cases where gnutls is compiled without zlib support.
* guile: Implement session record ports using the Guile 2.2 API.tmp-guile2.2Ludovic Courtès2016-10-051-5/+82
| | | | | | | | | | | | | | This allows the Guile bindings to be built and used with Guile >= 2.1.4, which introduced a new port API. * guile/src/core.c (USING_GUILE_BEFORE_2_2): New macro. (session_record_port_type) [!USING_GUILE_BEFORE_2_2]: New definition. (read_from_session_record_port, write_to_session_record_port) (make_session_record_port) [!USING_GUILE_BEFORE_2_2]: New functions. Conditionalize the other same-named functions on USING_GUILE_BEFORE_2_2. (scm_init_gnutls_session_record_port_type): Use 'read_from_session_record_port' when !USING_GUILE_BEFORE_2_2.
* guile: Test 'set-session-transport-fd!'.Ludovic Courtès2016-10-051-1/+1
| | | | | * guile/tests/session-record-port.scm: Use 'set-session-transport-fd!' on the server side.
* guile: Guile 2.x 'uniform-vector-read!' replacement returns 0 upon EOF.Ludovic Courtès2016-10-051-3/+6
| | | | | | | | This problem was never hit in practice because our tests always got the non-EOF case. * guile/modules/gnutls/build/tests.scm (uniform-vector-read!) [guile-2]: Return 0 upon EOF.
* doc updateNikos Mavrogiannopoulos2016-09-111-1/+1
|
* guile: Fix out-of-tree builds.Ludovic Courtès2016-02-221-1/+1
| | | | | | This fixes a regression introduced in 3045a96. * guile/Makefile.am (.in.scm): Make the parent directory of $@.
* guile: Work around lack of 'eval-when' on 1.8.Ludovic Courtès2016-02-151-1/+7
| | | | * guile/modules/gnutls.in (eval-when) [!guile-2]: New macro.
* guile: build: Make silent rules actually quiet.Ludovic Courtès2016-02-152-12/+13
| | | | | | * guile/Makefile.am (.in.scm): Use $(AM_V_GEN) and $(AM_V_at). * guile/src/Makefile.am (enums.h, enum-map.i.c) (smobs.h, smob-types.i.c, %.x): Likewise.
* guile: Build and install .go files on Guile 2.x.Ludovic Courtès2016-02-153-82/+117
| | | | | | | | | | * configure.ac: Check for 'guild' and substitute 'GUILD'. Define 'HAVE_GUILD'. Substitute 'guileobjectdir'. Don't output guile/modules/Makefile and guile/tests/Makefile. * guile/modules/Makefile.am, guile/tests/Makefile.am: Remove. Move contents to... * guile/Makefile.am: ... here. (SUBDIRS): Remove 'modules' and 'tests'.
* guile: tests: Add Guile 2.2 compatibility layer.Ludovic Courtès2016-02-151-2/+27
| | | | | | | | | This allows tests to run with Guile 2.1/2.2. * guile/modules/gnutls/build/tests.scm (define-replacement) [guile-2]: New macro. (uniform-vector-read!, uniform-vector-write) [guile-2]: New procedures. * doc/gnutls-guile.texi (Guile Preparations): Mention 2.2.
* guile: tests: Make sure no processes are left behind.Ludovic Courtès2016-02-154-3/+7
| | | | | | | | Before that, child processes would be left behind and become zombies. * guile/tests/anonymous-auth.scm, guile/tests/openpgp-auth.scm, guile/tests/session-record-port.scm, guile/tests/x509-auth.scm: Add (waitpid pid) call on the server side.
* guile: tests: Add 'with-child-process'.Ludovic Courtès2016-02-157-210/+255
| | | | | | | | | | | | | | This makes sure that child processes always exit no matter what. * guile/modules/gnutls/build/tests.scm (define-syntax-rule) [!guile-2]: New macro. (call-with-child-process): New procedure. (with-child-process): New macro. * guile/tests/anonymous-auth.scm, guile/tests/openpgp-auth.scm, guile/tests/session-record-port.scm, guile/tests/x509-auth.scm: Use it instead of an explicit 'primitive-fork' call. * guile/.dir-locals.el: New file. * guile/Makefile.am (EXTRA_DIST): New variable.
* guile: Call 'load-extension' both during expansion and at run time.Ludovic Courtès2015-01-081-6/+7
| | | | | | | Fixes <https://bugzilla.redhat.com/show_bug.cgi?id=1177847>. * guile/modules/gnutls.in: Wrap '%libdir' definition and 'load-extension' call in 'eval-when'.
* guile: Open binary file in binary mode, for the sake of MinGW.Ludovic Courtès2014-12-111-2/+2
| | | | | | | Reported by Eli Zaretskii <eliz@gnu.org>. * guile/tests/openpgp-keyring.scm: Use 'open-file' with "rb" instead of 'open-input-file'.
* guile: Link with '-no-undefined'.Ludovic Courtès2014-12-111-1/+5
| | | | | | | | Fixes builds on MinGW. Reported by Eli Zaretskii <eliz@gnu.org>. * guile/src/Makefile.am (guile_gnutls_v_2_la_LDFLAGS): Add -no-undefined.
* guile: Build with warnings.Ludovic Courtès2014-12-041-1/+7
| | | | | * guile/src/Makefile.am (AM_CFLAGS) [HAVE_GCC]: Add -Wall -Wextra -Wno-unused-parameter.
* guile: Remove the deprecated priority API.Ludovic Courtès2014-12-048-223/+16
| | | | | | | | | | | | | | * guile/modules/gnutls/build/priorities.scm: Remove. * guile/src/make-session-priorities.scm: Remove. * guile/modules/Makefile.am (EXTRA_DIST): Adjust accordingly. * guile/src/Makefile.am (EXTRA_DIST): Likewise. (GENERATED_BINDINGS): Remove 'priorities.i.c'. (priorities.i.c): Remove target. * guile/src/core.c: Don't include it. (scm_gnutls_set_default_priority_x): Remove. * guile/modules/gnutls.in (gnutls): Adjust export list. * guile/tests/session-record-port.scm: Use 'set-session-priorities!'. * guile/tests/x509-auth.scm: Likewise.