From e0972d3d962548972872d889b362560e499340d1 Mon Sep 17 00:00:00 2001 From: Andrey Jivsov Date: Wed, 5 Jan 2011 17:33:17 -0800 Subject: Integrating http://code.google.com/p/gnupg-ecc/source/detail?r=15 . The following works: gpg2 --gen-key (ECC) gpg2 --list-keys gpg2 --list-packets ~/.gnupg/pubring.gpg gpg2 --list-packets ECDH doesn't work yet as the code must be re-written to adjust for gpg-agent refactoring. --- include/cipher.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/cipher.h') diff --git a/include/cipher.h b/include/cipher.h index 8e198283d..65cd59e76 100644 --- a/include/cipher.h +++ b/include/cipher.h @@ -56,6 +56,8 @@ #define PUBKEY_ALGO_RSA_S /* 3 */ GCRY_PK_RSA_S /* RSA sign only. */ #define PUBKEY_ALGO_ELGAMAL_E /* 16 */ GCRY_PK_ELG_E /* Elgamal encr only */ #define PUBKEY_ALGO_DSA /* 17 */ GCRY_PK_DSA +#define PUBKEY_ALGO_ECDH 18 /* corresponds to GCRY_PK_ECDH ECC DH; encrypt only */ +#define PUBKEY_ALGO_ECDSA 19 /* corresponds to GCRY_PK_ECDSA ECC DSA; sign only */ #define PUBKEY_ALGO_ELGAMAL /* 20 */ GCRY_PK_ELG /* Elgamal encr+sign */ #define PUBKEY_USAGE_SIG GCRY_PK_USAGE_SIGN /* Good for signatures. */ -- cgit v1.2.3 From 90b0ff23b7e51332592668e4034967c1aac1c593 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 21 Jan 2011 12:00:57 +0100 Subject: Editorial changes and allow building with old libgcrypts. Changed order of some conditional to make to put the special case into the true branch. Indentation changes. Minor other changes to make the ECC code more similar to the rest of our code. It builds but many sefltests still fail. Need to fix that before using it with an ECDH enabled libgcrypt. [/] 2011-01-21 Werner Koch * configure.ac: Need Libgcrypt 1.4.6 due to AESWRAP. (HAVE_GCRY_PK_ECDH): Add new test. [agent/] 2011-01-21 Werner Koch * cvt-openpgp.c (GCRY_PK_ECDH) [!HAVE_GCRY_PK_ECDH]: New. [include/] 2011-01-21 Werner Koch * cipher.h (GCRY_PK_USAGE_CERT): Remove compatibility macros because we now require libgcrypt 1.4.6. (GCRY_PK_ECDH): Add replacement. --- include/cipher.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'include/cipher.h') diff --git a/include/cipher.h b/include/cipher.h index 65cd59e76..03d38da5b 100644 --- a/include/cipher.h +++ b/include/cipher.h @@ -1,6 +1,6 @@ /* cipher.h - Definitions for OpenPGP * Copyright (C) 1998, 1999, 2000, 2001, 2006, - * 2007 Free Software Foundation, Inc. + * 2007, 2010 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -23,10 +23,8 @@ #include /* Macros for compatibility with older libgcrypt versions. */ -#ifndef GCRY_PK_USAGE_CERT -# define GCRY_PK_USAGE_CERT 4 -# define GCRY_PK_USAGE_AUTH 8 -# define GCRY_PK_USAGE_UNKN 128 +#ifndef HAVE_GCRY_PK_ECDSA +# define GCRY_PK_ECDH 302 #endif @@ -56,8 +54,8 @@ #define PUBKEY_ALGO_RSA_S /* 3 */ GCRY_PK_RSA_S /* RSA sign only. */ #define PUBKEY_ALGO_ELGAMAL_E /* 16 */ GCRY_PK_ELG_E /* Elgamal encr only */ #define PUBKEY_ALGO_DSA /* 17 */ GCRY_PK_DSA -#define PUBKEY_ALGO_ECDH 18 /* corresponds to GCRY_PK_ECDH ECC DH; encrypt only */ -#define PUBKEY_ALGO_ECDSA 19 /* corresponds to GCRY_PK_ECDSA ECC DSA; sign only */ +#define PUBKEY_ALGO_ECDH 18 +#define PUBKEY_ALGO_ECDSA 19 #define PUBKEY_ALGO_ELGAMAL /* 20 */ GCRY_PK_ELG /* Elgamal encr+sign */ #define PUBKEY_USAGE_SIG GCRY_PK_USAGE_SIGN /* Good for signatures. */ -- cgit v1.2.3 From b9958bba10f40a348d40c173701d15cb6b0a7f66 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 24 Jan 2011 18:16:03 +0100 Subject: Fix another stupid bug ECDH detection bug Again reported by Johan van Selst. Let's see whether this one is okay. --- include/cipher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/cipher.h') diff --git a/include/cipher.h b/include/cipher.h index 03d38da5b..311020857 100644 --- a/include/cipher.h +++ b/include/cipher.h @@ -23,7 +23,7 @@ #include /* Macros for compatibility with older libgcrypt versions. */ -#ifndef HAVE_GCRY_PK_ECDSA +#ifndef HAVE_GCRY_PK_ECDH # define GCRY_PK_ECDH 302 #endif -- cgit v1.2.3 From 4659c923a08002a72cb4bb5b3c4e6a02d7484767 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 2 Feb 2011 15:48:54 +0100 Subject: Sample ECC keys and message do now work. Import and export of secret keys does now work. Encryption has been fixed to be compatible with the sample messages. This version tests for new Libgcrypt function and thus needs to be build with a new Libgcrypt installed. --- include/cipher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/cipher.h') diff --git a/include/cipher.h b/include/cipher.h index 311020857..4667e8043 100644 --- a/include/cipher.h +++ b/include/cipher.h @@ -100,8 +100,8 @@ typedef struct /* Constants to allocate static MPI arrays. */ -#define PUBKEY_MAX_NPKEY 4 -#define PUBKEY_MAX_NSKEY 6 +#define PUBKEY_MAX_NPKEY 5 +#define PUBKEY_MAX_NSKEY 7 #define PUBKEY_MAX_NSIG 2 #define PUBKEY_MAX_NENC 2 -- cgit v1.2.3