summaryrefslogtreecommitdiff
path: root/egg
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2017-08-08 18:34:01 +0200
committerDaiki Ueno <ueno@gnu.org>2017-10-13 08:51:04 +0200
commit32680d2667410c8d1802e10746084253daee65d0 (patch)
tree5871b40b69533179204fd9c2f6c72012dadf53e3 /egg
parentd96bb48a91bdd2075c08b781dc0b1c49db6f89c6 (diff)
downloadgnome-keyring-32680d2667410c8d1802e10746084253daee65d0.tar.gz
ASN.1 definitions of ECDSA and helper functions for DER encoding and decoding
https://bugzilla.gnome.org/show_bug.cgi?id=641082
Diffstat (limited to 'egg')
-rw-r--r--egg/pk.asn22
-rw-r--r--egg/pk.asn.h20
2 files changed, 41 insertions, 1 deletions
diff --git a/egg/pk.asn b/egg/pk.asn
index 347323cf..17e3a5be 100644
--- a/egg/pk.asn
+++ b/egg/pk.asn
@@ -101,5 +101,27 @@ DHParameter ::= SEQUENCE {
privateValueLength INTEGER OPTIONAL
}
+-- FROM New PKIX ASN.1 [RFC5912], RFC5915
+
+Parameters ::= CHOICE {
+ namedCurve OBJECT IDENTIFIER,
+ implicitlyCA NULL
+}
+
+-- bogus attribute used to encode Q into CKA_EC_POINT
+ECKeyQ ::= OCTET STRING
+
+ECPrivateKey ::= SEQUENCE {
+ version INTEGER { ecPrivkeyVer1(1) }, -- should be 1
+ d OCTET STRING, -- private key
+ parameters [0] Parameters OPTIONAL, -- OID
+ q [1] BIT STRING OPTIONAL -- public key
+}
+
+-- can't find definition anywhere, but works
+ECPublicKey ::= SEQUENCE {
+ parameters [0] Parameters OPTIONAL, -- OID
+ q [1] BIT STRING -- public key
+}
END
diff --git a/egg/pk.asn.h b/egg/pk.asn.h
index 618cccad..53d547a6 100644
--- a/egg/pk.asn.h
+++ b/egg/pk.asn.h
@@ -2,6 +2,7 @@
# include "config.h"
#endif
+/* Generated using asn1Parser pk.asn -o pk.asn.h */
/* #include <libtasn1.h> */
const ASN1_ARRAY_TYPE pk_asn1_tab[] = {
@@ -63,9 +64,26 @@ const ASN1_ARRAY_TYPE pk_asn1_tab[] = {
{ "g", 1073741827, NULL },
{ "Y", 1073741827, NULL },
{ "priv", 3, NULL },
- { "DHParameter", 536870917, NULL },
+ { "DHParameter", 1610612741, NULL },
{ "prime", 1073741827, NULL },
{ "base", 1073741827, NULL },
{ "privateValueLength", 16387, NULL },
+ { "Parameters", 1610612754, NULL },
+ { "namedCurve", 1073741836, NULL },
+ { "implicitlyCA", 20, NULL },
+ { "ECKeyQ", 1073741831, NULL },
+ { "ECPrivateKey", 1610612741, NULL },
+ { "version", 1610874883, NULL },
+ { "ecPrivkeyVer1", 1, "1"},
+ { "d", 1073741831, NULL },
+ { "parameters", 1610637314, "Parameters"},
+ { NULL, 2056, "0"},
+ { "q", 536895494, NULL },
+ { NULL, 2056, "1"},
+ { "ECPublicKey", 536870917, NULL },
+ { "parameters", 1610637314, "Parameters"},
+ { NULL, 2056, "0"},
+ { "q", 536879110, NULL },
+ { NULL, 2056, "1"},
{ NULL, 0, NULL }
};