summaryrefslogtreecommitdiff
path: root/egg
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2020-01-29 20:23:28 +0300
committerDmitry Baryshkov <dbaryshkov@gmail.com>2020-01-30 12:26:02 +0300
commit9f0659c7e5f858a3298a7e6a9bff8c490f713b66 (patch)
treef8b6efc1e7caf3cb8d37e587a9a5d989407061f4 /egg
parent927bb943ce5e2938cce365d1f14cdbb3ba308990 (diff)
downloadgcr-9f0659c7e5f858a3298a7e6a9bff8c490f713b66.tar.gz
gcr: add support for parsing GOST public keys/certificates
Add support for parsing certificates/public keys according to RFC 4491 and draft-deremin-4491-bis. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'egg')
-rw-r--r--egg/egg-oid.c7
-rw-r--r--egg/pk.asn13
-rw-r--r--egg/pk.asn.h9
3 files changed, 28 insertions, 1 deletions
diff --git a/egg/egg-oid.c b/egg/egg-oid.c
index e604846..d0e7207 100644
--- a/egg/egg-oid.c
+++ b/egg/egg-oid.c
@@ -109,6 +109,13 @@ static OidInfo oid_info[] = {
{ 0, "1.2.840.10045.4.3.3", "sha384WithECDSA", N_("SHA384 with ECDSA"), 0 },
{ 0, "1.2.840.10045.4.3.4", "sha512WithECDSA", N_("SHA512 with ECDSA"), 0 },
+ { 0, "1.2.643.2.2.3", "gostR3411-94-with-gostR3410-2001", N_("GOST R 34.11-94 with GOST R 34.10-2001"), 0 },
+ { 0, "1.2.643.2.2.19", "gostr3410-2001", N_("GOST R 34.10-2001"), 0 },
+ { 0, "1.2.643.7.1.1.1.1", "gost-3410-2012-256", N_("GOST R 34.10-2012 256-bit curve"), 0 },
+ { 0, "1.2.643.7.1.1.1.2", "gost-3410-2012-512", N_("GOST R 34.10-2012 512-bit curve"), 0 },
+ { 0, "1.2.643.7.1.1.3.2", "signwithdigest-gost-3410-2012-256", N_("GOST R 34.11-2012/256 with GOST R 34.10-2012 256-bit curve"), 0 },
+ { 0, "1.2.643.7.1.1.3.3", "signwithdigest-gost-3410-2012-512", N_("GOST R 34.11-2012/512 with GOST R 34.10-2012 512-bit curve"), 0 },
+
/* Extended Key Usages */
{ 0, "1.3.6.1.5.5.7.3.1", NULL, N_("Server Authentication"), 0 },
{ 0, "1.3.6.1.5.5.7.3.2", NULL, N_("Client Authentication"), 0 },
diff --git a/egg/pk.asn b/egg/pk.asn
index de0a74a..56bd6ea 100644
--- a/egg/pk.asn
+++ b/egg/pk.asn
@@ -125,4 +125,17 @@ ECPrivateKey ::= SEQUENCE {
publicKey [1] BIT STRING OPTIONAL
}
+-- The GOST public key parameters, defined by RFC 4491
+
+GostR3410-2001-PublicKeyParameters ::= SEQUENCE {
+ publicKeyParamSet OBJECT IDENTIFIER,
+ digestParamSet OBJECT IDENTIFIER,
+ encryptionParamSet OBJECT IDENTIFIER OPTIONAL
+}
+
+GostR3410-2012-PublicKeyParameters ::= SEQUENCE {
+ publicKeyParamSet OBJECT IDENTIFIER,
+ digestParamSet OBJECT IDENTIFIER OPTIONAL
+}
+
END
diff --git a/egg/pk.asn.h b/egg/pk.asn.h
index e0f8125..95b9d50 100644
--- a/egg/pk.asn.h
+++ b/egg/pk.asn.h
@@ -70,7 +70,7 @@ const asn1_static_node pk_asn1_tab[] = {
{ "ECPoint", 1073741831, NULL },
{ "ECParameters", 1610612754, NULL },
{ "namedCurve", 12, NULL },
- { "ECPrivateKey", 536870917, NULL },
+ { "ECPrivateKey", 1610612741, NULL },
{ "version", 1610874883, NULL },
{ "ecPrivkeyVer1", 1, "1"},
{ "privateKey", 1073741831, NULL },
@@ -78,5 +78,12 @@ const asn1_static_node pk_asn1_tab[] = {
{ NULL, 2056, "0"},
{ "publicKey", 536895494, NULL },
{ NULL, 2056, "1"},
+ { "GostR3410-2001-PublicKeyParameters", 1610612741, NULL },
+ { "publicKeyParamSet", 1073741836, NULL },
+ { "digestParamSet", 1073741836, NULL },
+ { "encryptionParamSet", 16396, NULL },
+ { "GostR3410-2012-PublicKeyParameters", 536870917, NULL },
+ { "publicKeyParamSet", 1073741836, NULL },
+ { "digestParamSet", 16396, NULL },
{ NULL, 0, NULL }
};