Add |EVP_dss1| as an alias for |EVP_sha1| in decrepit.
Change-Id: I51fa744c367d1f0c7044050f99c4992778e649bd
Reviewed-on: https://boringssl-review.googlesource.com/8030
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/decrepit/evp/CMakeLists.txt b/decrepit/evp/CMakeLists.txt
index ee3bf33..e631a9a 100644
--- a/decrepit/evp/CMakeLists.txt
+++ b/decrepit/evp/CMakeLists.txt
@@ -5,5 +5,6 @@
OBJECT
+ dss1.c
evp_do_all.c
)
diff --git a/decrepit/evp/dss1.c b/decrepit/evp/dss1.c
new file mode 100644
index 0000000..9c370ac
--- /dev/null
+++ b/decrepit/evp/dss1.c
@@ -0,0 +1,20 @@
+/* Copyright (c) 2016, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+#include <openssl/digest.h>
+
+
+const EVP_MD *EVP_dss1(void) {
+ return EVP_sha1();
+}
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
index db3ead7..07ea07a 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -212,6 +212,12 @@
* |name|, or NULL if the name is unknown. */
OPENSSL_EXPORT const EVP_MD *EVP_get_digestbyname(const char *);
+/* EVP_dss1 returns the value of EVP_sha1(). This was provided by OpenSSL to
+ * specifiy the original DSA signatures, which were fixed to use SHA-1. Note,
+ * however, that attempting to sign or verify DSA signatures with the EVP
+ * interface will always fail. */
+OPENSSL_EXPORT const EVP_MD *EVP_dss1(void);
+
/* Digest operation accessors. */