summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-04-04 18:16:03 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-04-04 18:16:03 +0000
commit0b33dac3100c68ab19a6be804cdeaaa87582b9a0 (patch)
tree4e4e480f898e6d2cedf0cc802f3144a25b415931 /crypto
parente2bce37720b4a165ffeb8172bfd504fbdd17e379 (diff)
New function to retrieve ASN1 info on public key algorithms. New command
line option to print out info.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/ameth_lib.c19
-rw-r--r--crypto/asn1/asn1_locl.h3
-rw-r--r--crypto/dh/dh_ameth.c2
-rw-r--r--crypto/evp/evp.h6
4 files changed, 26 insertions, 4 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 3616816c1c..6f98872cf1 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -186,6 +186,25 @@ int EVP_PKEY_asn1_add(const EVP_PKEY_ASN1_METHOD *ameth)
return 1;
}
+int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags,
+ const char **pinfo, const char **ppem_str,
+ const EVP_PKEY_ASN1_METHOD *ameth)
+ {
+ if (!ameth)
+ return 0;
+ if (ppkey_id)
+ *ppkey_id = ameth->pkey_id;
+ if (ppkey_base_id)
+ *ppkey_base_id = ameth->pkey_base_id;
+ if (ppkey_flags)
+ *ppkey_flags = ameth->pkey_flags;
+ if (pinfo)
+ *pinfo = ameth->info;
+ if (ppem_str)
+ *ppem_str = ameth->pem_str;
+ return 1;
+ }
+
EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
const char *pem_str, const char *info)
{
diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h
index d21108d9bb..a81f56238f 100644
--- a/crypto/asn1/asn1_locl.h
+++ b/crypto/asn1/asn1_locl.h
@@ -71,9 +71,6 @@ struct asn1_pctx_st
/* ASN1 public key method structure */
-#define ASN1_PKEY_ALIAS 0x1
-#define ASN1_PKEY_DYNAMIC 0x2
-
struct evp_pkey_asn1_method_st
{
int pkey_id;
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index ba3ff562a1..03b40d0e5c 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -149,7 +149,7 @@ const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
EVP_PKEY_DH,
0,
- "dh",
+ "DH",
"OpenSSL PKCS#3 DH method",
0,
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index 9378d441e3..e4cbd2d68f 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -856,11 +856,17 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
EVP_PBE_KEYGEN *keygen);
void EVP_PBE_cleanup(void);
+#define ASN1_PKEY_ALIAS 0x1
+#define ASN1_PKEY_DYNAMIC 0x2
+
int EVP_PKEY_asn1_get_count(void);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(int type);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(const char *str, int len);
int EVP_PKEY_asn1_add(const EVP_PKEY_ASN1_METHOD *ameth);
+int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags,
+ const char **pinfo, const char **ppem_str,
+ const EVP_PKEY_ASN1_METHOD *ameth);
EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
const char *pem_str, const char *info);