From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CL8xG3x1zWPhdAAAbAwnHQ (envelope-from ) for ; Sun, 22 Jan 2023 18:42:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oBVdGnx1zWNNVAAAG6o9tA (envelope-from ) for ; Sun, 22 Jan 2023 18:42:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0252535AC4 for ; Sun, 22 Jan 2023 18:42:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJeLZ-0005yt-L6; Sun, 22 Jan 2023 12:41:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJeLX-0005tv-93 for emacs-orgmode@gnu.org; Sun, 22 Jan 2023 12:41:35 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJeLV-0005SG-61 for emacs-orgmode@gnu.org; Sun, 22 Jan 2023 12:41:35 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pJeLT-0003Xz-G3 for emacs-orgmode@gnu.org; Sun, 22 Jan 2023 18:41:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Karl Voit Subject: org-crypt fails if default key is expired while non-default key is to be used Date: Sun, 22 Jan 2023 18:41:23 +0100 Organization: www.karl-voit.at Message-ID: <2023-01-22T18-32-17@devnull.Karl-Voit.at> User-Agent: slrn/1.0.3 (Linux) X-GPG-Key: http://www.Karl-Voit.at/Karl_Voit_GnuPG_public_key.gpg X-Registered-Linux-User: 224337 X-Confession: Pastafarian http://www.venganza.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Karl Voit Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674409340; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=+iYIcr1CvZgac09dKi0C82oFkZjx5LbhkDyRChAv618=; b=MtFTAZDtTfVF2v4u92cBwn37hAwZ3WVi/8uVJHNO8mPhF6yYijCQlVr2wpHUJ6z3IzXUs6 kC6StZqN9by80+ibhJ0Ujem47ogTAFXgTptabVqUlvDtxx0HylHoA2h7bcWfmnUw8wqevj FZp0sRimHW62hReCcuqdm2f83dQfdIx01eku73mx4wq/jfIHzAohXNeQb36WMDcQiISOng 8JwNItcy9uOquGZ1z2AfszMPNi9b/dKnHfIX0k1Hwx2dT+U7xM0vvoz/+INC1CowNHwnN/ WJEMCz67A+TjhamRDL+nKlWukp8dSMC3xtlkR8Mne6uUM30vIVUVc+83F9OPdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674409340; a=rsa-sha256; cv=none; b=SfBUuZIQfVcl6DCs6v02PykgfZGVdliwJmGRsvrBNeVb5byItU/ZepaRs3ebsFq9H2PLP+ a5lOaxFYpwUta2/xzeGcEEfRXRwyw5YzCJrYl54Pd/R1QYOP1SmwWY0zrHP73Gv3JD31cY 4NG7FgnXpHna5IvwJkUs3HdBB3LuZdhiZFK7jBrO3jrRmUzYrkmJyzx+Mo6rguZBnZ5VPW AnGuGhJzD5lqw8TcPvnV/Yl+YREOfFh6W/w3dWzKsjPTXUrdCEpSzYroxc+i41laZ607j7 4idlTYUzyKda8cTIEFpIVBxhOPa0YnGS65cPKTEDuOG96gGc36qlsIQhRd7eKg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.39 X-Spam-Score: -1.39 X-Migadu-Queue-Id: 0252535AC4 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: 2c0X950H/nW0 Hi, I think I've found a bug with org-crypt: Org mode version 9.5.5 (release_9.5.5 @ /home/vk/src/external_compilations/emacs/lisp/org/) GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-01-09 SUMMARY: org-crypt fails to encrypt when org-encrypt-entry is set to a different key than the default openpgp key and the default key is expired. BACKGROUND: My setup involves an openpgp-key which is specifically used for org-crypt. This key is not my default key A1234567 which I'm using for encrypting and singing emails and such. org-crypt-key is set to this secondary key, let's call it org-openpgp-key. So the org-crypt setup is correct in that sense that org-mode should not care about other keys than my org-openpgp-key. However, I've had the situation where the default openpgp key expired on a machine. Please note that my org-openpgp-key did not expire. When I invoked org-decrypt-entry, decrypting works like always. Then I modified something in this heading which is tagged with :crypt:. On saving that buffer, org-crypt issues an error message: | Error: (error "GPG error: \"Encrypt failed\", \"Unusable public key: | A1234567; Exit\"") This A1234567 key is my default key and not the org-openpgp-key. org-encrypt-entry is causing this error at: | ;; Text and key have to be identical, otherwise we | ;; re-crypt. | (if (and (equal crypt-key key) | (string= checksum (sha1 contents))) | (get-text-property 0 'org-crypt-text contents) | (epg-encrypt-string epg-context contents crypt-key))) After fixing the expiry date of A1234567, org-crypt was working properly, using the correct org-openpgp-key again. I do think this is wrong behavior: when the default key is expired but a specific secondary key is used, encryption should be possible. -- get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode: > get Memacs from https://github.com/novoid/Memacs < Personal Information Management > http://Karl-Voit.at/tags/pim/ Emacs-related > http://Karl-Voit.at/tags/emacs/