Skip to content

Commit 9933f9e

Browse files
committed
Support ECC alg
Add support for alg 12, 13 and 14
1 parent 64d7f1b commit 9933f9e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

rr.c

+14
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,14 @@ int extract_algorithm(char **s, char *what)
720720
return ALG_RSASHA256;
721721
if (strcmp(str_alg, "rsasha512") == 0)
722722
return ALG_RSASHA512;
723+
724+
if (strcmp(str_alg, "ecc-gost") == 0)
725+
return ALG_ECCGOST;
726+
if (strcmp(str_alg, "ecdsap256sha256") == 0)
727+
return ALG_ECDSAP256SHA256;
728+
if (strcmp(str_alg, "ecdsap384sha384") == 0)
729+
return ALG_ECDSAP384SHA384;
730+
723731
if (strcmp(str_alg, "privatedns") == 0)
724732
return ALG_PRIVATEDNS;
725733
if (strcmp(str_alg, "privateoid") == 0)
@@ -744,6 +752,12 @@ int algorithm_type(int alg)
744752
return ALG_RSA_FAMILY;
745753
case ALG_RSASHA512:
746754
return ALG_RSA_FAMILY;
755+
case ALG_ECCGOST:
756+
return ALG_ECC_FAMILY;
757+
case ALG_ECDSAP256SHA256:
758+
return ALG_ECC_FAMILY;
759+
case ALG_ECDSAP384SHA384:
760+
return ALG_ECC_FAMILY;
747761
case ALG_PRIVATEDNS:
748762
return ALG_PRIVATE_FAMILY;
749763
case ALG_PRIVATEOID:

rr.h

+4
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@
4040
#define ALG_RSASHA1_NSEC3_SHA1 7
4141
#define ALG_RSASHA256 8
4242
#define ALG_RSASHA512 10
43+
#define ALG_ECCGOST 12
44+
#define ALG_ECDSAP256SHA256 13
45+
#define ALG_ECDSAP384SHA384 14
4346
#define ALG_PRIVATEDNS 253
4447
#define ALG_PRIVATEOID 254
4548

4649
#define ALG_UNSUPPORTED 0
4750
#define ALG_DSA_FAMILY 1
4851
#define ALG_RSA_FAMILY 2
4952
#define ALG_PRIVATE_FAMILY 3
53+
#define ALG_ECC_FAMILY 4
5054

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

0 commit comments

Comments
 (0)