Browse Source

Elliptic curve support

Reading in the keys now works, lets see what goes wrong next
master
David Lanzendörfer 12 months ago
parent
commit
412ce4d7bf
6 changed files with 257 additions and 75 deletions
  1. +37
    -3
      include/netpgp/packet.h
  2. +52
    -4
      src/create.c
  3. +6
    -0
      src/gskssl_crypto.c
  4. +6
    -0
      src/openssl_crypto.c
  5. +154
    -66
      src/packet-parse.c
  6. +2
    -2
      src/packet-show.c

+ 37
- 3
include/netpgp/packet.h View File

@ -365,14 +365,13 @@ typedef enum {
* \see RFC4880 13.5) */
PGP_PKA_ELGAMAL = 0x10, /* Elgamal (Encrypt-Only) */
PGP_PKA_DSA = 0x11, /* DSA (Digital Signature Algorithm) */
PGP_PKA_ECDH = 0x12, /* RFC-6637 */
PGP_PKA_RESERVED_ECDSA = 0x13, /* Reserved for ECDSA */
PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN = 0x14, /* Deprecated. */
PGP_PKA_RESERVED_DH = 0x15, /* Reserved for Diffie-Hellman
* (X9.42, as defined for
* IETF-S/MIME) */
PGP_PKA_RESERVED_ELLIPTIC_CURVE_18 = 0x12, /* Elliptic Curve(pub 18) */
PGP_PKA_RESERVED_ELLIPTIC_CURVE_22 = 0x16, /* Elliptic Curve(pub 22) */
PGP_PKA_EDDSA = 0x16, /* RFC-8032 */
PGP_PKA_PRIVATE00 = 0x64, /* Private/Experimental Algorithm */
PGP_PKA_PRIVATE01 = 0x65, /* Private/Experimental Algorithm */
@ -440,6 +439,18 @@ typedef struct {
#endif
} pgp_elgamal_pubkey_t;
/** Structure to hold an ECDH public key params.
*
* \see RFC8037 (page 9)
*/
typedef struct {
#if defined(HAVE_GSKSSL)
gsk_buffer *x;
#elif defined(HAVE_OPENSSL)
BIGNUM *x;
#endif
} pgp_ecdh_pubkey_t;
/** Version.
* OpenPGP has two different protocol versions: version 3 and version 4.
*
@ -466,6 +477,7 @@ typedef struct {
pgp_dsa_pubkey_t dsa; /* A DSA public key */
pgp_rsa_pubkey_t rsa; /* An RSA public key */
pgp_elgamal_pubkey_t elgamal; /* An ElGamal public key */
pgp_ecdh_pubkey_t ecdh; /* An ElGamal public key */
} key; /* Public Key Parameters */
} pgp_pubkey_t;
@ -503,6 +515,19 @@ typedef struct {
#endif
} pgp_elgamal_seckey_t;
/** pgp_ecdh_seckey_t
* According to RFC8037 (page 9)
* */
typedef struct {
#if defined(HAVE_GSKSSL)
gsk_buffer *d;
gsk_buffer *x;
#elif defined(HAVE_OPENSSL)
BIGNUM *d;
BIGNUM *x;
#endif
} pgp_ecdh_seckey_t;
/** s2k_usage_t
*/
typedef enum {
@ -676,6 +701,15 @@ typedef struct pgp_elgamal_sig_t {
#endif
} pgp_elgamal_sig_t;
/** pgp_ecdh_signature_t */
typedef struct pgp_ecdh_sig_t {
#if defined(HAVE_GSKSSL)
gsk_buffer *s;
#elif defined(HAVE_OPENSSL)
BIGNUM *s;
#endif
} pgp_ecdh_sig_t;
#define PGP_KEY_ID_SIZE 8
#define PGP_FINGERPRINT_SIZE 20


+ 52
- 4
src/create.c View File

@ -204,6 +204,12 @@ static unsigned
pubkey_length(const pgp_pubkey_t *key)
{
switch (key->alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,key->alg);
break;
case PGP_PKA_DSA:
return mpi_length(key->key.dsa.p) + mpi_length(key->key.dsa.q) +
mpi_length(key->key.dsa.g) + mpi_length(key->key.dsa.y);
@ -228,6 +234,11 @@ seckey_length(const pgp_seckey_t *key)
int len;
switch (key->pubkey.alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,key->pubkey.alg);
break;
case PGP_PKA_DSA:
return (unsigned)(mpi_length(key->key.dsa.x) + pubkey_length(&key->pubkey));
case PGP_PKA_RSA:
@ -305,9 +316,12 @@ write_pubkey_body(const pgp_pubkey_t *key, pgp_output_t *output)
pgp_write_mpi(output, key->key.elgamal.g) &&
pgp_write_mpi(output, key->key.elgamal.y);
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
return pgp_write_mpi(output, key->key.ecdh.x);
default:
(void) fprintf(stderr,
"write_pubkey_body: bad algorithm\n");
(void) fprintf(stderr, "write_pubkey_body: bad algorithm (%x)\n",key->alg);
break;
}
return 0;
@ -490,6 +504,11 @@ write_seckey_body(const pgp_seckey_t *key,
}
switch (key->pubkey.alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,key->pubkey.alg);
break;
case PGP_PKA_RSA:
case PGP_PKA_RSA_ENCRYPT_ONLY:
case PGP_PKA_RSA_SIGN_ONLY:
@ -918,6 +937,12 @@ encode_m_buf(const uint8_t *M, size_t mLen, const pgp_pubkey_t * pubkey,
/* implementation of EME-PKCS1-v1_5-ENCODE, as defined in OpenPGP RFC */
switch (pubkey->alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pubkey->alg);
break;
case PGP_PKA_RSA:
#if defined(HAVE_OPENSSL)
k = (unsigned)BN_num_bytes(pubkey->key.rsa.n);
@ -1005,6 +1030,12 @@ pgp_create_pk_sesskey(pgp_key_t *key, const char *ciphername, pgp_pk_sesskey_t *
return NULL;
}
switch(pubkey->alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pubkey->alg);
break;
case PGP_PKA_RSA:
#if defined(HAVE_OPENSSL)
sz_encoded_m_buf = BN_num_bytes(pubkey->key.rsa.n);
@ -1052,6 +1083,12 @@ pgp_create_pk_sesskey(pgp_key_t *key, const char *ciphername, pgp_pk_sesskey_t *
hexdump(stderr, "Encrypting for keyid", id, sizeof(sesskey->key_id));
}
switch (pubkey->alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pubkey->alg);
break;
case PGP_PKA_RSA:
case PGP_PKA_DSA:
case PGP_PKA_ELGAMAL:
@ -1093,6 +1130,12 @@ pgp_create_pk_sesskey(pgp_key_t *key, const char *ciphername, pgp_pk_sesskey_t *
/* and encrypt it */
switch (key->key.pubkey.alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,key->key.pubkey.alg);
break;
case PGP_PKA_RSA:
if (!pgp_rsa_encrypt_mpi(encoded_m_buf, sz_encoded_m_buf, pubkey,
&sesskey->params)) {
@ -1137,6 +1180,12 @@ pgp_write_pk_sesskey(pgp_output_t *output, pgp_pk_sesskey_t *pksk)
return 0;
}
switch (pksk->alg) {
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pksk->alg);
break;
case PGP_PKA_RSA:
return pgp_write_ptag(output, PGP_PTAG_CT_PK_SESSION_KEY) &&
pgp_write_length(output, (unsigned)(1 + 8 + 1 +
@ -1176,8 +1225,7 @@ pgp_write_pk_sesskey(pgp_output_t *output, pgp_pk_sesskey_t *pksk)
/* ?? && pgp_write_scalar(output, 0, 2); */
;
default:
(void) fprintf(stderr,
"pgp_write_pk_sesskey: bad algorithm\n");
(void) fprintf(stderr, "pgp_write_pk_sesskey: bad algorithm (%x)\n", pksk->alg);
return 0;
}
}


+ 6
- 0
src/gskssl_crypto.c View File

@ -1096,6 +1096,12 @@ pgp_rsa_generate_keypair(pgp_key_t *keydata,
case PGP_PKA_ELGAMAL:
return pgp_write_mpi(output, seckey->key.elgamal.x);
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,seckey->pubkey.alg);
return 0;
default:
(void) fprintf(stderr, "Bad seckey->pubkey.alg\n");
return 0;


+ 6
- 0
src/openssl_crypto.c View File

@ -820,6 +820,12 @@ pgp_rsa_generate_keypair(pgp_key_t *keydata,
case PGP_PKA_ELGAMAL:
return pgp_write_mpi(output, seckey->key.elgamal.x);
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,seckey->pubkey.alg);
return 0;
default:
(void) fprintf(stderr, "Bad seckey->pubkey.alg\n");
return 0;


+ 154
- 66
src/packet-parse.c View File

@ -714,6 +714,56 @@ limread_mpi(gsk_buffer **pbn, pgp_region_t *region, pgp_stream_t *stream)
return 1;
}
static int
#if defined(HAVE_OPENSSL)
sos_read(BIGNUM **pbn, pgp_region_t *region, pgp_stream_t *stream)
#elif defined(HAVE_GSKSSL)
sos_read(gsk_buffer **pbn, pgp_region_t *region, pgp_stream_t *stream)
#endif
{
uint8_t buf[NETPGP_BUFSIZ] = "";
/* an MPI has a 2 byte length part.
* Length is given in bits, so the
* largest we should ever need for
* the buffer is NETPGP_BUFSIZ bytes. */
uint8_t c, c1, c2;
int32_t i, ret;
unsigned int nbits, nbytes;
size_t nread = 0;
uint8_t *p;
ret=limread(&c1, 1, region, stream);
if(!ret) return 0;
c = c1;
nbits = c << 8;
ret=limread(&c2, 1, region, stream);
if(!ret) return 0;
c = c2;
nbits |= c;
nbytes = (nbits + 7) / 8;
p = buf;
for (i = 0; i < nbytes; i++)
{
ret = limread(&c, 1, region, stream);
if (!ret)
break;
p[i] = c;
nread ++;
}
#if defined(HAVE_OPENSSL)
*pbn = BN_bin2bn(buf, nread, NULL);
#elif defined(HAVE_GSKSSL)
(*pbn)=malloc(sizeof(gsk_buffer));
(*pbn)->length=nread;
(*pbn)->data=malloc(nread);
memcpy((*pbn)->data,buf,nread);
#endif
return 1;
}
static unsigned read_new_length(unsigned *, pgp_stream_t *);
@ -942,13 +992,6 @@ cmd_get_passphrase_free(pgp_seckey_passphrase_t *skp)
\brief Free allocated memory
*/
#if defined(HAVE_OPENSSL)
static void
free_BN(BIGNUM **pp)
{
BN_free(*pp);
*pp = NULL;
}
static void
dup_BN(BIGNUM **dst, const BIGNUM *src)
{
@ -1021,8 +1064,8 @@ copy_sig_info(pgp_sig_info_t *dst, const pgp_sig_info_t *src)
pgp_data_dup(&dst->sig.unknown, &src->sig.unknown);
break;
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,src->key_alg);
break;
@ -1045,22 +1088,35 @@ pgp_free_sig_info(pgp_sig_info_t *info)
case PGP_PKA_RSA:
case PGP_PKA_RSA_SIGN_ONLY:
#if defined(HAVE_OPENSSL)
free_BN(&info->sig.rsa.sig);
BN_free(info->sig.rsa.sig);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.rsa.sig);
#endif
info->sig.rsa.sig=NULL;
break;
case PGP_PKA_DSA:
#if defined(HAVE_OPENSSL)
free_BN(&info->sig.dsa.r);
free_BN(&info->sig.dsa.s);
BN_free(info->sig.dsa.r);
BN_free(info->sig.dsa.s);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.dsa.r);
gsk_free_buffer(&info->sig.dsa.s);
#endif
info->sig.dsa.r=NULL;
info->sig.dsa.s=NULL;
break;
case PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN:
#if defined(HAVE_OPENSSL)
free_BN(&info->sig.elgamal.r);
free_BN(&info->sig.elgamal.s);
BN_free(info->sig.elgamal.r);
BN_free(info->sig.elgamal.s);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&info->sig.elgamal.r);
gsk_free_buffer(&info->sig.elgamal.s);
#endif
info->sig.elgamal.r=NULL;
info->sig.elgamal.s=NULL;
break;
case PGP_PKA_PRIVATE00:
@ -1077,8 +1133,8 @@ pgp_free_sig_info(pgp_sig_info_t *info)
pgp_data_free(&info->sig.unknown);
break;
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,info->key_alg);
break;
@ -1274,23 +1330,31 @@ void
pgp_pk_sesskey_free(pgp_pk_sesskey_t *sk)
{
switch (sk->alg) {
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,sk->alg);
break;
case PGP_PKA_RSA:
#if defined(HAVE_OPENSSL)
free_BN(&sk->params.rsa.encrypted_m);
BN_free(sk->params.rsa.encrypted_m);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&sk->params.rsa.encrypted_m);
#endif
sk->params.rsa.encrypted_m=NULL;
break;
case PGP_PKA_ELGAMAL:
#if defined(HAVE_OPENSSL)
free_BN(&sk->params.elgamal.g_to_k);
free_BN(&sk->params.elgamal.encrypted_m);
BN_free(sk->params.elgamal.g_to_k);
BN_free(sk->params.elgamal.encrypted_m);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&sk->params.elgamal.g_to_k);
gsk_free_buffer(&sk->params.elgamal.encrypted_m);
#endif
sk->params.elgamal.g_to_k=NULL;
sk->params.elgamal.encrypted_m=NULL;
break;
default:
@ -1312,33 +1376,58 @@ pgp_pubkey_free(pgp_pubkey_t *p)
case PGP_PKA_RSA_ENCRYPT_ONLY:
case PGP_PKA_RSA_SIGN_ONLY:
#if defined(HAVE_OPENSSL)
free_BN(&p->key.rsa.n);
free_BN(&p->key.rsa.e);
BN_free(p->key.rsa.n);
BN_free(p->key.rsa.e);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.rsa.n);
gsk_free_buffer(&p->key.rsa.e);
#endif
p->key.rsa.n=NULL;
p->key.rsa.e=NULL;
break;
case PGP_PKA_DSA:
#if defined(HAVE_OPENSSL)
free_BN(&p->key.dsa.p);
free_BN(&p->key.dsa.q);
free_BN(&p->key.dsa.g);
free_BN(&p->key.dsa.y);
BN_free(p->key.dsa.p);
BN_free(p->key.dsa.q);
BN_free(p->key.dsa.g);
BN_free(p->key.dsa.y);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.dsa.p);
gsk_free_buffer(&p->key.dsa.q);
gsk_free_buffer(&p->key.dsa.g);
gsk_free_buffer(&p->key.dsa.y);
#endif
p->key.dsa.p=NULL;
p->key.dsa.q=NULL;
p->key.dsa.g=NULL;
p->key.dsa.y=NULL;
break;
case PGP_PKA_ELGAMAL:
case PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN:
#if defined(HAVE_OPENSSL)
free_BN(&p->key.elgamal.p);
free_BN(&p->key.elgamal.g);
free_BN(&p->key.elgamal.y);
BN_free(p->key.elgamal.p);
BN_free(p->key.elgamal.g);
BN_free(p->key.elgamal.y);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.elgamal.p);
gsk_free_buffer(&p->key.elgamal.g);
gsk_free_buffer(&p->key.elgamal.y);
#endif
p->key.elgamal.p=NULL;
p->key.elgamal.g=NULL;
p->key.elgamal.y=NULL;
break;
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,p->alg);
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
#if defined(HAVE_OPENSSL)
BN_free(p->key.ecdh.x);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&p->key.ecdh.x);
#endif
p->key.ecdh.x=NULL;
break;
case PGP_PKA_NOTHING:
@ -1357,8 +1446,8 @@ pgp_pubkey_dup(pgp_pubkey_t *dst, pgp_pubkey_t *src)
memcpy(dst, src, sizeof(*src));
switch (src->alg) {
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,src->alg);
break;
@ -1432,12 +1521,10 @@ parse_pubkey_data(pgp_pubkey_t *key, pgp_region_t *region,
pgp_stream_t *stream)
{
uint8_t c = 0x0;
BIGNUM *a, *b, *p, *order, *x, *y;
int testl;
if (region->readc != 0) {
/* We should not have read anything so far */
//(void) fprintf(stderr, "parse_pubkey_data: bad length\n");
(void) fprintf(stderr, "parse_pubkey_data: bad length\n");
return 0;
}
if (!limread(&c, 1, region, stream)) {
@ -1495,20 +1582,9 @@ parse_pubkey_data(pgp_pubkey_t *key, pgp_region_t *region,
}
break;
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,key->alg);
for(int i=0;i<50;i++) {
limread_scalar(&testl, 1, region, stream);
printf("testl=%x\n",testl);
}
//limread_mpi(a, region, stream);
//limread_mpi(b, region, stream);
//limread_mpi(p, region, stream);
//limread_mpi(order, region, stream);
//limread_mpi(x, region, stream);
//limread_mpi(y, region, stream);
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
if(!sos_read(&key->key.ecdh.x, region, stream)) return 0;
break;
default:
@ -1730,8 +1806,8 @@ parse_v3_sig(pgp_region_t *region,
}
switch (pkt.u.sig.info.key_alg) {
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pkt.u.sig.info.key_alg);
break;
@ -2305,8 +2381,8 @@ parse_v4_sig(pgp_region_t *region, pgp_stream_t *stream)
}
break;
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pkt.u.sig.info.key_alg);
break;
@ -2560,17 +2636,29 @@ pgp_seckey_free(pgp_seckey_t *key)
case PGP_PKA_RSA_ENCRYPT_ONLY:
case PGP_PKA_RSA_SIGN_ONLY:
#if defined(HAVE_OPENSSL)
free_BN(&key->key.rsa.d);
free_BN(&key->key.rsa.p);
free_BN(&key->key.rsa.q);
free_BN(&key->key.rsa.u);
BN_free(key->key.rsa.d);
BN_free(key->key.rsa.p);
BN_free(key->key.rsa.q);
BN_free(key->key.rsa.u);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&key->key.rsa.d);
gsk_free_buffer(&key->key.rsa.p);
gsk_free_buffer(&key->key.rsa.q);
gsk_free_buffer(&key->key.rsa.u);
#endif
key->key.rsa.d=NULL;
key->key.rsa.p=NULL;
key->key.rsa.q=NULL;
key->key.rsa.u=NULL;
break;
case PGP_PKA_DSA:
#if defined(HAVE_OPENSSL)
free_BN(&key->key.dsa.x);
BN_free(key->key.dsa.x);
#elif defined(HAVE_GSKSSL)
gsk_free_buffer(&key->key.dsa.x);
#endif
key->key.dsa.x=NULL;
break;
default:
@ -2914,8 +3002,8 @@ parse_seckey(pgp_content_enum tag, pgp_region_t *region, pgp_stream_t *stream)
fprintf(stderr, "parse_seckey: checkhash, reading MPIs\n");
}
switch (pkt.u.seckey.pubkey.alg) {
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pkt.u.seckey.pubkey.alg);
break;
@ -3071,8 +3159,8 @@ parse_pk_sesskey(pgp_region_t *region,
}
pkt.u.pk_sesskey.alg = (pgp_pubkey_alg_t)c;
switch (pkt.u.pk_sesskey.alg) {
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_22:
case PGP_PKA_RESERVED_ELLIPTIC_CURVE_18:
case PGP_PKA_EDDSA:
case PGP_PKA_ECDH:
// TODO
printf("%s:%d, %s: Elliptic curves pub(%d)\n",__FILE__,__LINE__,__FUNCTION__,pkt.u.pk_sesskey.alg);
break;


+ 2
- 2
src/packet-show.c View File

@ -215,8 +215,8 @@ static pgp_map_t pubkey_alg_map[] =
{PGP_PKA_RSA_SIGN_ONLY, "RSA Sign-Only"},
{PGP_PKA_ELGAMAL, "Elgamal (Encrypt-Only)"},
{PGP_PKA_DSA, "DSA"},
{PGP_PKA_RESERVED_ELLIPTIC_CURVE_18, "Reserved for Elliptic Curve (pub 18)"},
{PGP_PKA_RESERVED_ELLIPTIC_CURVE_22, "Reserved for Elliptic Curve (pub 22) "},
{PGP_PKA_EDDSA, "EDDSA"},
{PGP_PKA_ECDH, "ECDH"},
{PGP_PKA_RESERVED_ECDSA, "Reserved for ECDSA"},
{PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN, "Reserved (formerly Elgamal Encrypt or Sign"},
{PGP_PKA_RESERVED_DH, "Reserved for Diffie-Hellman (X9.42)"},


Loading…
Cancel
Save