aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-06-23 22:06:21 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-06-23 22:06:21 -0400
commit3aadabf82fd81948334aa3e72510d64b16d96a15 (patch)
tree0bffee232bbdfbc3499e80f051dba3e4a46fbd88
parent45de23a64653a68e8c23b892f0b017b6c4a57213 (diff)
downloadcryptography-3aadabf82fd81948334aa3e72510d64b16d96a15.tar.gz
cryptography-3aadabf82fd81948334aa3e72510d64b16d96a15.tar.bz2
cryptography-3aadabf82fd81948334aa3e72510d64b16d96a15.zip
Added teh OID for ECDSA with SHA1.
In practice this is rare because the BR requires ECDSA signatures to use SHA256+ (or maybe the requirements for SHA256 just came at the same time as ECDSA, idk)
-rw-r--r--docs/x509.rst5
-rw-r--r--src/cryptography/x509.py3
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/x509.rst b/docs/x509.rst
index 1e4efb4c..b8e3c8ee 100644
--- a/docs/x509.rst
+++ b/docs/x509.rst
@@ -1267,6 +1267,11 @@ Signature Algorithm OIDs
Corresponds to the dotted string ``"1.2.840.113549.1.1.13"``. This is
a SHA512 digest signed by an RSA key.
+.. data:: OID_ECDSA_WITH_SHA1
+
+ Corresponds to the dotted string ``"1.2.840.10045.4.1"``. This is a SHA1
+ digest signed by an ECDSA key.
+
.. data:: OID_ECDSA_WITH_SHA224
Corresponds to the dotted string ``"1.2.840.10045.4.3.1"``. This is
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 1d705e70..4b030ca9 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -36,6 +36,7 @@ _OID_NAMES = {
"1.2.840.113549.1.1.11": "sha256WithRSAEncryption",
"1.2.840.113549.1.1.12": "sha384WithRSAEncryption",
"1.2.840.113549.1.1.13": "sha512WithRSAEncryption",
+ "1.2.840.10045.4.1": "ecdsa-with-SHA1",
"1.2.840.10045.4.3.1": "ecdsa-with-SHA224",
"1.2.840.10045.4.3.2": "ecdsa-with-SHA256",
"1.2.840.10045.4.3.3": "ecdsa-with-SHA384",
@@ -1206,6 +1207,7 @@ OID_RSA_WITH_SHA224 = ObjectIdentifier("1.2.840.113549.1.1.14")
OID_RSA_WITH_SHA256 = ObjectIdentifier("1.2.840.113549.1.1.11")
OID_RSA_WITH_SHA384 = ObjectIdentifier("1.2.840.113549.1.1.12")
OID_RSA_WITH_SHA512 = ObjectIdentifier("1.2.840.113549.1.1.13")
+OID_ECDSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10045.4.1")
OID_ECDSA_WITH_SHA224 = ObjectIdentifier("1.2.840.10045.4.3.1")
OID_ECDSA_WITH_SHA256 = ObjectIdentifier("1.2.840.10045.4.3.2")
OID_ECDSA_WITH_SHA384 = ObjectIdentifier("1.2.840.10045.4.3.3")
@@ -1221,6 +1223,7 @@ _SIG_OIDS_TO_HASH = {
OID_RSA_WITH_SHA256.dotted_string: hashes.SHA256(),
OID_RSA_WITH_SHA384.dotted_string: hashes.SHA384(),
OID_RSA_WITH_SHA512.dotted_string: hashes.SHA512(),
+ OID_ECDSA_WITH_SHA1.dotted_string: hashes.SHA1(),
OID_ECDSA_WITH_SHA224.dotted_string: hashes.SHA224(),
OID_ECDSA_WITH_SHA256.dotted_string: hashes.SHA256(),
OID_ECDSA_WITH_SHA384.dotted_string: hashes.SHA384(),