summaryrefslogtreecommitdiffstats
path: root/crypto/include
diff options
context:
space:
mode:
authorDavid Makepeace <david.p.makepeace@oracle.com>2019-06-03 14:58:54 +1000
committerPauli <paul.dale@oracle.com>2019-07-12 06:26:46 +1000
commit54846b7c6ef5718f507def9d192628133f97fe20 (patch)
tree4d6810f0dda7442ec72619737c0724322e024ace /crypto/include
parent35e264c03232c7843733caa80f8e16bef7e2e829 (diff)
Add simple ASN.1 utils for DSA signature DER.
Adds simple utility functions to allow both the default and fips providers to encode and decode DSA-Sig-Value and ECDSA-Sig-Value (DSA_SIG and ECDSA_SIG structures) to/from ASN.1 DER without requiring those providers to have a dependency on the asn1 module. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9111)
Diffstat (limited to 'crypto/include')
-rw-r--r--crypto/include/internal/asn1_dsa.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/include/internal/asn1_dsa.h b/crypto/include/internal/asn1_dsa.h
new file mode 100644
index 0000000000..7c720a1733
--- /dev/null
+++ b/crypto/include/internal/asn1_dsa.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef HEADER_ASN1_DSA_H
+# define HEADER_ASN1_DSA_H
+
+size_t encode_der_length(size_t cont_len, unsigned char **ppout, size_t len);
+size_t encode_der_integer(const BIGNUM *n, unsigned char **ppout, size_t len);
+size_t encode_der_dsa_sig(const BIGNUM *r, const BIGNUM *s,
+ unsigned char **ppout, size_t len);
+size_t decode_der_length(size_t *pcont_len, const unsigned char **ppin,
+ size_t len);
+size_t decode_der_integer(BIGNUM *n, const unsigned char **ppin, size_t len);
+size_t decode_der_dsa_sig(BIGNUM *r, BIGNUM *s, const unsigned char **ppin,
+ size_t len);
+
+#endif