From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nikolaos Chatzikonstantinou Newsgroups: gmane.emacs.bugs Subject: bug#50507: New function in Emacs GnuTLS implementation Date: Mon, 26 Sep 2022 17:39:09 -0400 Message-ID: References: <83ee9wiozc.fsf@gnu.org> <87sflkgy49.fsf@gnus.org> <87edwd15ck.fsf@gnus.org> <87tu4u8kjv.fsf@gnus.org> <878rm69hop.fsf@gmail.com> 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="35999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50507@debbugs.gnu.org, Lars Ingebrigtsen , Eli Zaretskii To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 26 23:43:58 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 1ocvtO-0009G2-BJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Sep 2022 23:43:58 +0200 Original-Received: from localhost ([::1]:60110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocvtN-0005Z4-EC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Sep 2022 17:43:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocvpb-00010i-Nf for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 17:40:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocvpb-0005ih-EW for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 17:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ocvpa-0002R8-BB for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 17:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nikolaos Chatzikonstantinou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Sep 2022 21:40:02 +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.16642283769330 (code B ref 50507); Mon, 26 Sep 2022 21:40:02 +0000 Original-Received: (at 50507) by debbugs.gnu.org; 26 Sep 2022 21:39:36 +0000 Original-Received: from localhost ([127.0.0.1]:51964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocvp4-0002QJ-2t for submit@debbugs.gnu.org; Mon, 26 Sep 2022 17:39:36 -0400 Original-Received: from mail-yw1-f179.google.com ([209.85.128.179]:35740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocvp0-0002Q6-Rb for 50507@debbugs.gnu.org; Mon, 26 Sep 2022 17:39:27 -0400 Original-Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-3511e80f908so19452827b3.2 for <50507@debbugs.gnu.org>; Mon, 26 Sep 2022 14:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=5iRqShQAY6F+jyRBs/p0/rKAwH2iV+wmY4rC8kSfsGA=; b=O+GnsNM/b3hO3Av+0+rZ+Kez9z8MuQ4VX9CdSR+N7894T44JLdA8iBLD0SEMjxShVp F2skvUK+hDwmtQNAsGLlowGwlCaRAlQEqvCKKBeA0TawuEuZLaoo9waUwg+d4KB5LgPk ay8E2E//XqorEQd3OSbjgby9TjfWR8PCNicO5ifVYB7ozOUD5XBelmrL9A4K3IJvYHBT /Qy0tOdMpExu1hvW/VUh9sg/qtdc/YnSl0kKCN9lJQ4vGMVbVfKBX4dndiPGehjlczxn rllZ149nIjac+vEkgQBah6cYJluHfh3n/ZZn117HvnRrCgdR2fk+lf7CRC8a2NGAOFMz W8lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=5iRqShQAY6F+jyRBs/p0/rKAwH2iV+wmY4rC8kSfsGA=; b=TXatkonrsL0poCOTF+zz0VGOoYeWLdciyHCI4DP3P6v2hve9c6hWMqCXCmRp7SWHXC dAYEptEFmfOt/uDQ8cWdkAna6hRHYI+Pfvp9X6ro11dOws7Jc3u9Dr1DeZcvTQHPm+Kv +yfXpi51pnNVVnxm7JZ7tDdfeUMGZtM3sMHwrxYbBwfPg6giGKjvEqsuRyWcxYEov0/l 3o+KLH4/F0/L7X7Cvi507kQDlaPn1vK/AgO4pU/qNXCcLyfrqi97IqJeXNEklj1blGBS Fv6gpZ9t0A+1dvqeLYS05FV5fBzrwOKA9PhLz6+Yp9zFDvH2lxbZoOjcaK9I8QoyMy1J UWrQ== X-Gm-Message-State: ACrzQf3yLoTmbrl0jgjbl6Nm/YlKDv5d5kanl3QO+0OBtvYxBhFmZPEI DJgZTWvdqYU72wp5Nem+9DQ7hYkWsfDcUPYIcMs= X-Google-Smtp-Source: AMsMyM7nQQ+yrtVoAP7Dk9FzvfQw4/O8wYKbZjLx4rWrcuxYevy8s1dKIj7akzTx/vL2ltIov4HF74zOoKobVsfUyGw= X-Received: by 2002:a0d:e6cf:0:b0:349:ef2b:1940 with SMTP id p198-20020a0de6cf000000b00349ef2b1940mr22248896ywe.331.1664228360377; Mon, 26 Sep 2022 14:39:20 -0700 (PDT) In-Reply-To: <878rm69hop.fsf@gmail.com> 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:243679 Archived-At: On Mon, Sep 26, 2022 at 1:19 PM Robert Pluim wrote: > > >>>>> 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 f= or 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-paramete= rs are > Nikolaos> modified to include the :pass and :flags keys, which are ad= ditional > Nikolaos> parameters in the second version. > > Nikolaos> +PASS is a string, the password of the key. > Nikolaos> + > Nikolaos> +FLAGS is an ORed sequence of gnutls_pkcs_encrypt_flags_t v= alues. > Nikolaos> + > > You=CA=BCre at the lisp level here. Perhaps you could define a mapping fr= om > 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. Does Emacs code have a way to signal this C-to-lisp enum-to-defconst map? Otherwise I will go with the keywords option. > 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.... > > > > ...this is likely to fail in that case. Or maybe not, I haven=CA=BCt test= ed > it, but XUFIXNUM(nil) in a build with asserts enabled will trigger an > assert and exit, I think. Thanks, I will look into this. > In any case, if you=CA=BCre going to replace _file with _file2, you shoul= d > 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. Okay, will do. The first version of the function exists since 0.4.0 but the second appeared "recently" in 3.2.0 (released on June 2013). Should I put some preprocessor #if checks? How would the docstring be affected? Instead of duplicating the string (can't put #if inside its body, it's already in a macro), perhaps I should write that the feature is "only supported with GnuTLS 3.2.0 and above")