all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: emacs-devel@gnu.org
Cc: ueno@unixuser.org, mwolson@gnu.org
Subject: [PATCH] Update epg.el algorithm id-name association lists
Date: Sat, 22 Jun 2019 09:48:38 +0300	[thread overview]
Message-ID: <87d0j6xghl.fsf@iki.fi> (raw)

[-- Attachment #1: Type: text/plain, Size: 4108 bytes --]

Add some new algorithm identifier numbers and names to the following
defconst definitions in file epg.el:

    epg-cipher-algorithm-alist
    epg-pubkey-algorithm-alist
    epg-digest-algorithm-alist
    epg-compress-algorithm-alist

The identifiers come from GnuPG (The GNU Privacy Guard) source code
file "common/openpgpdefs.h". The relevant parts are quoted below.

    typedef enum
      {
        CIPHER_ALGO_NONE	    =  0,
        CIPHER_ALGO_IDEA	    =  1,
        CIPHER_ALGO_3DES	    =  2,
        CIPHER_ALGO_CAST5	    =  3,
        CIPHER_ALGO_BLOWFISH    =  4, /* 128 bit */
        /* 5 & 6 are reserved */
        CIPHER_ALGO_AES         =  7,
        CIPHER_ALGO_AES192      =  8,
        CIPHER_ALGO_AES256      =  9,
        CIPHER_ALGO_TWOFISH	    = 10, /* 256 bit */
        CIPHER_ALGO_CAMELLIA128 = 11,
        CIPHER_ALGO_CAMELLIA192 = 12,
        CIPHER_ALGO_CAMELLIA256 = 13,
        CIPHER_ALGO_PRIVATE10   = 110
      }
    cipher_algo_t;

[...]

    typedef enum
      {
        PUBKEY_ALGO_RSA         =  1,
        PUBKEY_ALGO_RSA_E       =  2, /* RSA encrypt only (legacy). */
        PUBKEY_ALGO_RSA_S       =  3, /* RSA sign only (legacy).    */
        PUBKEY_ALGO_ELGAMAL_E   = 16, /* Elgamal encrypt only.      */
        PUBKEY_ALGO_DSA         = 17,
        PUBKEY_ALGO_ECDH        = 18, /* RFC-6637  */
        PUBKEY_ALGO_ECDSA       = 19, /* RFC-6637  */
        PUBKEY_ALGO_ELGAMAL     = 20, /* Elgamal encrypt+sign (legacy).  */
        /*                        21     reserved by OpenPGP.            */
        PUBKEY_ALGO_EDDSA       = 22, /* EdDSA (not yet assigned).       */
        PUBKEY_ALGO_PRIVATE10   = 110
      }
    pubkey_algo_t;

    typedef enum
      {
        DIGEST_ALGO_MD5         =  1,
        DIGEST_ALGO_SHA1        =  2,
        DIGEST_ALGO_RMD160      =  3,
        /* 4, 5, 6, and 7 are reserved. */
        DIGEST_ALGO_SHA256      =  8,
        DIGEST_ALGO_SHA384      =  9,
        DIGEST_ALGO_SHA512      = 10,
        DIGEST_ALGO_SHA224      = 11,
        DIGEST_ALGO_PRIVATE10   = 110
      }
    digest_algo_t;

    typedef enum
      {
        COMPRESS_ALGO_NONE      =  0,
        COMPRESS_ALGO_ZIP       =  1,
        COMPRESS_ALGO_ZLIB      =  2,
        COMPRESS_ALGO_BZIP2     =  3,
        COMPRESS_ALGO_PRIVATE10 = 110
      }
    compress_algo_t;
---
 lisp/epg.el | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index 0400716845..e8bdd1536f 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -41,7 +41,7 @@ epg-debug-buffer
 (defvar epg-agent-file nil)
 (defvar epg-agent-mtime nil)
 
-;; from gnupg/include/cipher.h
+;; from gnupg/common/openpgpdefs.h
 (defconst epg-cipher-algorithm-alist
   '((0 . "NONE")
     (1 . "IDEA")
@@ -56,16 +56,20 @@ epg-cipher-algorithm-alist
     (12 . "CAMELLIA256")
     (110 . "DUMMY")))
 
-;; from gnupg/include/cipher.h
+;; from gnupg/common/openpgpdefs.h
 (defconst epg-pubkey-algorithm-alist
   '((1 . "RSA")
     (2 . "RSA_E")
     (3 . "RSA_S")
     (16 . "ELGAMAL_E")
     (17 . "DSA")
-    (20 . "ELGAMAL")))
+    (18 . "ECDH")
+    (19 . "ECDSA")
+    (20 . "ELGAMAL")
+    (22 . "EDDSA")
+    (110 . "PRIVATE10")))
 
-;; from gnupg/include/cipher.h
+;; from gnupg/common/openpgpdefs.h
 (defconst epg-digest-algorithm-alist
   '((1 . "MD5")
     (2 . "SHA1")
@@ -73,14 +77,16 @@ epg-digest-algorithm-alist
     (8 . "SHA256")
     (9 . "SHA384")
     (10 . "SHA512")
-    (11 . "SHA224")))
+    (11 . "SHA224")
+    (110 . "PRIVATE10")))
 
-;; from gnupg/include/cipher.h
+;; from gnupg/common/openpgpdefs.h
 (defconst epg-compress-algorithm-alist
   '((0 . "NONE")
     (1 . "ZIP")
     (2 . "ZLIB")
-    (3 . "BZIP2")))
+    (3 . "BZIP2")
+    (110 . "PRIVATE10")))
 
 (defconst epg-invalid-recipients-reason-alist
   '((0 . "No specific reason given")
-- 
2.11.0

-- 
/// Teemu Likonen   <https://github.com/tlikonen> //
// PGP: 4E1055DC84E9DFF613D78557719D69D324539450 ///

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

             reply	other threads:[~2019-06-22  6:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-22  6:48 Teemu Likonen [this message]
2019-06-22  9:07 ` [PATCH] Update epg.el algorithm id-name association lists Lars Ingebrigtsen
2019-06-22 11:44   ` Teemu Likonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0j6xghl.fsf@iki.fi \
    --to=tlikonen@iki.fi \
    --cc=emacs-devel@gnu.org \
    --cc=mwolson@gnu.org \
    --cc=ueno@unixuser.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.