Skip to content

Commit

Permalink
Support ECC alg
Browse files Browse the repository at this point in the history
Add support for alg 12, 13 and 14
  • Loading branch information
miekg committed Mar 22, 2012
1 parent 64d7f1b commit 9933f9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,14 @@ int extract_algorithm(char **s, char *what)
return ALG_RSASHA256;
if (strcmp(str_alg, "rsasha512") == 0)
return ALG_RSASHA512;

if (strcmp(str_alg, "ecc-gost") == 0)
return ALG_ECCGOST;
if (strcmp(str_alg, "ecdsap256sha256") == 0)
return ALG_ECDSAP256SHA256;
if (strcmp(str_alg, "ecdsap384sha384") == 0)
return ALG_ECDSAP384SHA384;

if (strcmp(str_alg, "privatedns") == 0)
return ALG_PRIVATEDNS;
if (strcmp(str_alg, "privateoid") == 0)
Expand All @@ -744,6 +752,12 @@ int algorithm_type(int alg)
return ALG_RSA_FAMILY;
case ALG_RSASHA512:
return ALG_RSA_FAMILY;
case ALG_ECCGOST:
return ALG_ECC_FAMILY;
case ALG_ECDSAP256SHA256:
return ALG_ECC_FAMILY;
case ALG_ECDSAP384SHA384:
return ALG_ECC_FAMILY;
case ALG_PRIVATEDNS:
return ALG_PRIVATE_FAMILY;
case ALG_PRIVATEOID:
Expand Down
4 changes: 4 additions & 0 deletions rr.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@
#define ALG_RSASHA1_NSEC3_SHA1 7
#define ALG_RSASHA256 8
#define ALG_RSASHA512 10
#define ALG_ECCGOST 12
#define ALG_ECDSAP256SHA256 13
#define ALG_ECDSAP384SHA384 14
#define ALG_PRIVATEDNS 253
#define ALG_PRIVATEOID 254

#define ALG_UNSUPPORTED 0
#define ALG_DSA_FAMILY 1
#define ALG_RSA_FAMILY 2
#define ALG_PRIVATE_FAMILY 3
#define ALG_ECC_FAMILY 4

#define RRCAST(t) struct rr_ ## t *rr = (struct rr_ ## t *)rrv

Expand Down

0 comments on commit 9933f9e

Please sign in to comment.