From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#50507: New function in Emacs GnuTLS implementation Date: Mon, 26 Sep 2022 19:19:50 +0200 Message-ID: <878rm69hop.fsf@gmail.com> References: <83ee9wiozc.fsf@gnu.org> <87sflkgy49.fsf@gnus.org> <87edwd15ck.fsf@gnus.org> <87tu4u8kjv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36712"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50507@debbugs.gnu.org, Lars Ingebrigtsen , Eli Zaretskii To: Nikolaos Chatzikonstantinou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 26 20:24:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ocsm8-0009LR-J0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Sep 2022 20:24:16 +0200 Original-Received: from localhost ([::1]:54308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocsm7-0003zW-Jp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Sep 2022 14:24:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocrmw-0007Pn-C3 for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 13:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocrmw-0007Ww-2b for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 13:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ocrmv-00027W-Tr for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 13:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Sep 2022 17:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50507 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 50507-submit@debbugs.gnu.org id=B50507.16642128028027 (code B ref 50507); Mon, 26 Sep 2022 17:21:01 +0000 Original-Received: (at 50507) by debbugs.gnu.org; 26 Sep 2022 17:20:02 +0000 Original-Received: from localhost ([127.0.0.1]:51687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocrlx-00025K-IY for submit@debbugs.gnu.org; Mon, 26 Sep 2022 13:20:02 -0400 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:42790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocrlv-000252-M8 for 50507@debbugs.gnu.org; Mon, 26 Sep 2022 13:20:00 -0400 Original-Received: by mail-wr1-f50.google.com with SMTP id n12so11260066wrx.9 for <50507@debbugs.gnu.org>; Mon, 26 Sep 2022 10:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=1nIDh3ihvt+AztMuNrVcPc4FIMwuvwbGnGhItUvxEJs=; b=fflewszTDWsc6ltoCbktF8TjZhZU4vfFoj8FUBaIgOGHLh9+mg0GBxbyjR9Ir/TwM7 qwdjicCOZxF1nF8uROx3EhPthR/S973KXgi1sszauOJQnlytC0wNhIyKFccN1riTccgd GRpSJiON2GJXcNvlfzEMCcBt4nZ8ue/Cesb2XaumooIVarzHIhmEd2jg04MKu6SWL1ky nmti5jJAD96tAlcWbz+/Q4IBDBkqb+F4/Vop7Z3+b0eg3ikJrpijNVnH6X05i1PBXCzE 8SyS8RUNj37yViDQIqTq7TRF6wVC8uc6thRHcIhpFy3f8B05qi76+v01gxSClVjAN0Sw UW9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=1nIDh3ihvt+AztMuNrVcPc4FIMwuvwbGnGhItUvxEJs=; b=ORhyPQnNLhmbd4EaUWRiFkVHes6wg3SCXWu71Q+WL8csTzrwVKFteJkqjy569w6Q4T wzKToB42KKdLG7z93CBvON0XYi4bDr1A1dM/sSPCccNE2zlf2Ns4jw+24u8gb+Hedbau mxjCfc9fOjVgjUv2yMj2R/jQy73Ag5QVvcOu5yiA3K/xl7CQYxxpV8i4f7nl405SbTgE McHdifyf0HnMeiYUrjBoZET7l2+g5SY0gheq6GQlibA1WpYkLlrgt7L0yTS31i+Mt+RJ xHqHbgespJCC1stcmWVPMzk2IjqqFDEaGHrsmvXruuURCZQ/goz6y6TaH9aQG2/5a9yk 9f2g== X-Gm-Message-State: ACrzQf16JDw1H/7NursvPGOvRvKAPOkPv9VqHrC/3Hcq4VnUfqU3AR0S agekDQFW0KmdlC+gkik8X0Y= X-Google-Smtp-Source: AMsMyM6xLK/xnjA+pNS3awH5zVhPHAeEm1YJdwbcj7MLIZqfQP52gn63qkukSRyU6wIbL6cKgMSreg== X-Received: by 2002:a5d:6485:0:b0:226:ecf9:359c with SMTP id o5-20020a5d6485000000b00226ecf9359cmr14830125wri.17.1664212793523; Mon, 26 Sep 2022 10:19:53 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:2e48:1c6b:2114:6f3b]) by smtp.gmail.com with ESMTPSA id e6-20020adff346000000b0022a53fe201fsm6991576wrp.68.2022.09.26.10.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 10:19:52 -0700 (PDT) In-Reply-To: (Nikolaos Chatzikonstantinou's message of "Mon, 26 Sep 2022 11:43:41 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243670 Archived-At: >>>>> On Mon, 26 Sep 2022 11:43:41 -0400, Nikolaos Chatzikonstantinou said: Nikolaos> Date: Mon, 26 Sep 2022 11:08:18 -0400 Nikolaos> Subject: [PATCH] fix(gnutls): add possibility of password for= key-file Nikolaos> The GnuTLS function Nikolaos> gnutls_certificate_set_x509_key_file Nikolaos> is replaced by its second version Nikolaos> gnutls_certificate_set_x509_key_file2 Nikolaos> and the definitions of gnutls-boot and gnutls-boot-parameters= are Nikolaos> modified to include the :pass and :flags keys, which are addi= tional Nikolaos> parameters in the second version. Nikolaos> Signed-off-by: Nikolaos Chatzikonstantinou Nikolaos> We don=CA=BCt use Signed-off-by, and the commit message has some rules which are described in CONTRIBUTE (start at "** Commit messages" and read up to and including "** Committing your changes") Nikolaos> +PASS is a string, the password of the key. Nikolaos> + Nikolaos> +FLAGS is an ORed sequence of gnutls_pkcs_encrypt_flags_t val= ues. Nikolaos> + You=CA=BCre at the lisp level here. Perhaps you could define a mapping from the C-level enum to lisp defconsts or similar? Or you could define it as taking a list of flags, and then the C-code can take care of ORing them. Nikolaos> + pass =3D plist_get (proplist, QCpass); Nikolaos> + flags =3D plist_get (proplist, QCflags); pass and flags will both be 'nil' here if they=CA=BCre not specified, so that.... Nikolaos> if (!STRINGP (hostname)) Nikolaos> { Nikolaos> @@ -2038,8 +2051,8 @@ DEFUN ("gnutls-boot", Fgnutls_boot, Sgn= utls_boot, 3, 3, 0, Nikolaos> keyfile =3D ansi_encode_filename (keyfile); Nikolaos> certfile =3D ansi_encode_filename (certfile); Nikolaos> # endif Nikolaos> - ret =3D gnutls_certificate_set_x509_key_file Nikolaos> - (x509_cred, SSDATA (certfile), SSDATA (keyfile), file_form= at); Nikolaos> + ret =3D gnutls_certificate_set_x509_key_file2 Nikolaos> + (x509_cred, SSDATA (certfile), SSDATA (keyfile), file_form= at, SSDATA (pass), XUFIXNUM (flags)); ...this is likely to fail in that case. Or maybe not, I haven=CA=BCt tested it, but XUFIXNUM(nil) in a build with asserts enabled will trigger an assert and exit, I think. In any case, if you=CA=BCre going to replace _file with _file2, you should describe the new constraints on the arguments. e.g. Maybe having pass as nil is OK, but then you need to say that, or maybe you need to fall back to _file if :pass is not specified. Robert --=20