aboutsummaryrefslogtreecommitdiff
path: root/crypto/evp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-03-22 17:59:49 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-03-22 17:59:49 +0000
commit18e377b4ffa6d15572d7283f1eb1743ce5875804 (patch)
tree60cbdb8623a4afd56950d7797727071b4486823b /crypto/evp
parent043b2e9c2ec57da817457c8108c13cf90ce572cb (diff)
downloadopenssl-18e377b4ffa6d15572d7283f1eb1743ce5875804.zip
openssl-18e377b4ffa6d15572d7283f1eb1743ce5875804.tar.gz
openssl-18e377b4ffa6d15572d7283f1eb1743ce5875804.tar.bz2
Make EVP_PKEY_ASN1_METHOD opaque. Add application level functions to
initialize it. Initial support for application added public key ASN1.
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp.h2
-rw-r--r--crypto/evp/evp_pkey.c12
-rw-r--r--crypto/evp/p_lib.c6
3 files changed, 8 insertions, 12 deletions
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index a2214c9..ab2a1e5 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -855,7 +855,7 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
EVP_PBE_KEYGEN *keygen);
void EVP_PBE_cleanup(void);
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_ASN1_find(int type);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(int type);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index 938541f..e81c4fe 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -61,13 +61,7 @@
#include "cryptlib.h"
#include <openssl/x509.h>
#include <openssl/rand.h>
-#ifndef OPENSSL_NO_RSA
-#include <openssl/rsa.h>
-#endif
-#ifndef OPENSSL_NO_DSA
-#include <openssl/dsa.h>
-#endif
-#include <openssl/bn.h>
+#include "asn1_locl.h"
/* Extract a private key from a PKCS8 structure */
@@ -86,7 +80,7 @@ EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8)
return NULL;
}
- meth = EVP_PKEY_ASN1_find(OBJ_obj2nid(algoid));
+ meth = EVP_PKEY_asn1_find(OBJ_obj2nid(algoid));
if (meth)
{
@@ -138,7 +132,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken)
}
p8->broken = broken;
- meth = EVP_PKEY_ASN1_find(pkey->type);
+ meth = EVP_PKEY_asn1_find(pkey->type);
if (meth)
{
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 7fd31b0..f18ac62 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -74,6 +74,8 @@
#include <openssl/dh.h>
#endif
+#include "asn1_locl.h"
+
static void EVP_PKEY_free_it(EVP_PKEY *x);
int EVP_PKEY_bits(EVP_PKEY *pkey)
@@ -189,7 +191,7 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key)
if (pkey == NULL) return(0);
if (pkey->pkey.ptr != NULL)
EVP_PKEY_free_it(pkey);
- ameth = EVP_PKEY_ASN1_find(type);
+ ameth = EVP_PKEY_asn1_find(type);
pkey->ameth = ameth;
pkey->type = ameth->pkey_id;
pkey->save_type=type;
@@ -284,7 +286,7 @@ DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey)
int EVP_PKEY_type(int type)
{
const EVP_PKEY_ASN1_METHOD *ameth;
- ameth = EVP_PKEY_ASN1_find(type);
+ ameth = EVP_PKEY_asn1_find(type);
if (ameth)
return ameth->pkey_id;
return NID_undef;