Add information and pem strings. Update dependencies.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 23 Mar 2006 11:54:51 +0000 (11:54 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 23 Mar 2006 11:54:51 +0000 (11:54 +0000)
14 files changed:
crypto/asn1/Makefile
crypto/asn1/ameth_lib.c
crypto/asn1/asn1_locl.h
crypto/dh/Makefile
crypto/dh/dh_ameth.c
crypto/dsa/Makefile
crypto/dsa/dsa_ameth.c
crypto/ec/Makefile
crypto/ec/ec_ameth.c
crypto/evp/Makefile
crypto/evp/evp.h
crypto/pem/pem_lib.c
crypto/rsa/Makefile
crypto/rsa/rsa_ameth.c

index fe6a4be27604a3d06459b14d71bec4cb0f5bf59d..15289d1fcc16d9909f021b24e13cae4b5a4bfa68 100644 (file)
@@ -279,7 +279,8 @@ a_type.o: ../../e_os.h ../../include/openssl/asn1.h
 a_type.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 a_type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 a_type.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
-a_type.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
+a_type.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+a_type.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 a_type.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 a_type.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 a_type.o: ../../include/openssl/symhacks.h ../cryptlib.h a_type.c
@@ -311,6 +312,21 @@ a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 a_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 a_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_verify.c
+ameth_lib.o: ../../e_os.h ../../include/openssl/asn1.h
+ameth_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
+ameth_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
+ameth_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+ameth_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
+ameth_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+ameth_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+ameth_lib.o: ../../include/openssl/objects.h
+ameth_lib.o: ../../include/openssl/opensslconf.h
+ameth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+ameth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
+ameth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
+ameth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
+ameth_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ameth_lib.c
+ameth_lib.o: asn1_locl.h
 asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 asn1_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 asn1_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
@@ -542,13 +558,11 @@ t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 t_crl.o: ../cryptlib.h t_crl.c
 t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
-t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
-t_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
-t_pkey.o: ../../include/openssl/ec.h ../../include/openssl/err.h
-t_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
-t_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
-t_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-t_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
+t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
+t_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
+t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
 t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 t_pkey.o: ../cryptlib.h t_pkey.c
 t_req.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -802,7 +816,7 @@ x_pubkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 x_pubkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 x_pubkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 x_pubkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
-x_pubkey.o: ../cryptlib.h x_pubkey.c
+x_pubkey.o: ../cryptlib.h asn1_locl.h x_pubkey.c
 x_req.o: ../../e_os.h ../../include/openssl/asn1.h
 x_req.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 x_req.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
index aeadaf7e6a0945f98bc70f2866224a63fadb0f66..d7537202de2885fbb50dc962c3ff8bb169ad0f32 100644 (file)
@@ -143,7 +143,8 @@ int EVP_PKEY_asn1_add(const EVP_PKEY_ASN1_METHOD *ameth)
        return 1;
        }
 
-EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id)
+EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
+                                       const char *pem_str, const char *info)
        {
        EVP_PKEY_ASN1_METHOD *ameth;
        ameth = OPENSSL_malloc(sizeof(EVP_PKEY_ASN1_METHOD));
@@ -153,6 +154,20 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id)
        ameth->pkey_id = id;
        ameth->pkey_base_id = id;
        ameth->pkey_flags = ASN1_PKEY_DYNAMIC;
+
+       if (info)
+               {
+               ameth->info = BUF_strdup(info);
+               if (!ameth->info)
+                       goto err;
+               }
+
+       if (pem_str)
+               {
+               ameth->pem_str = BUF_strdup(pem_str);
+               if (!ameth->pem_str)
+                       goto err;
+               }
        
        ameth->pub_decode = 0;
        ameth->pub_encode = 0;
@@ -180,6 +195,24 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id)
        ameth->pkey_ctrl = 0;
 
        return ameth;
+
+       err:
+
+       EVP_PKEY_asn1_free(ameth);
+       return NULL;
+
+       }
+
+void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
+       {
+       if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC))
+               {
+               if (ameth->pem_str)
+                       OPENSSL_free(ameth->pem_str);
+               if (ameth->info)
+                       OPENSSL_free(ameth->info);
+               OPENSSL_free(ameth);
+               }
        }
 
 void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
index 1328cdb106914f6dbd1d3f053f7dda0e4aa5047c..aafb5afdb88f88de9ebcd371643fb5b46b39f756 100644 (file)
@@ -80,6 +80,9 @@ struct evp_pkey_asn1_method_st
        int pkey_base_id;
        unsigned long pkey_flags;
 
+       char *pem_str;
+       char *info;
+
        int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub);
        int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
        int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
index c0867d296895327c4d7e93b3af794611b26660a5..5bd10507bd155612c3d4165ccf1cf7ede3f98582 100644 (file)
@@ -76,6 +76,20 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
+dh_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
+dh_ameth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+dh_ameth.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
+dh_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+dh_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
+dh_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+dh_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+dh_ameth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
+dh_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+dh_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
+dh_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
+dh_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
+dh_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
+dh_ameth.o: dh_ameth.c
 dh_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
 dh_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 dh_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -133,3 +147,12 @@ dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_lib.c
+dh_prn.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
+dh_prn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
+dh_prn.o: ../../include/openssl/dh.h ../../include/openssl/e_os2.h
+dh_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+dh_prn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+dh_prn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
+dh_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+dh_prn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
+dh_prn.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_prn.c
index d82a1c91c11a8b59f535d38531edbcd3110c30ed..bcc56a166e5abd5bc0795e13a815ab50db700365 100644 (file)
@@ -73,6 +73,9 @@ const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
        EVP_PKEY_DH,
        0,
 
+       "dh",
+       "OpenSSL PKCS#3 DH method",
+
        0,
        0,
        0,
index b1c067a1de0e8705e98ee37552c4b4bbff955b23..a926cf98798570af7503ff02b0230dc4c3c87e69 100644 (file)
@@ -76,6 +76,21 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
+dsa_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
+dsa_ameth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+dsa_ameth.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
+dsa_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+dsa_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
+dsa_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+dsa_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+dsa_ameth.o: ../../include/openssl/objects.h
+dsa_ameth.o: ../../include/openssl/opensslconf.h
+dsa_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+dsa_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
+dsa_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
+dsa_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
+dsa_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
+dsa_ameth.o: dsa_ameth.c
 dsa_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
 dsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 dsa_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@@ -142,6 +157,16 @@ dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 dsa_ossl.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
 dsa_ossl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 dsa_ossl.o: ../cryptlib.h dsa_ossl.c
+dsa_prn.o: ../../e_os.h ../../include/openssl/asn1.h
+dsa_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+dsa_prn.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
+dsa_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
+dsa_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
+dsa_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+dsa_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
+dsa_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
+dsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+dsa_prn.o: ../cryptlib.h dsa_prn.c
 dsa_sign.o: ../../e_os.h ../../include/openssl/asn1.h
 dsa_sign.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
index 7ef6aaa8d40bf86b23ad1b91a696dc52d0032b1d..26e274f859619bda966d8355a98049215abc3a2d 100644 (file)
@@ -526,6 +526,9 @@ const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] =
                EVP_PKEY_DSA,
                0,
 
+               "dsa",
+               "OpenSSL DSA method",
+
                dsa_pub_decode,
                dsa_pub_encode,
                dsa_pub_cmp,
index 7c2bdf82c2d401ea0225fe84fecb4ebc19d51e10..be7454a3e3fe7716db7e081b9c10a5d51ee24766 100644 (file)
@@ -95,6 +95,20 @@ ec2_smpl.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
 ec2_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 ec2_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 ec2_smpl.o: ../../include/openssl/symhacks.h ec2_smpl.c ec_lcl.h
+ec_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
+ec_ameth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+ec_ameth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+ec_ameth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
+ec_ameth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
+ec_ameth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
+ec_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+ec_ameth.o: ../../include/openssl/opensslconf.h
+ec_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+ec_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
+ec_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
+ec_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
+ec_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
+ec_ameth.o: ec_ameth.c
 ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -166,6 +180,16 @@ ec_print.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
 ec_print.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 ec_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 ec_print.o: ../../include/openssl/symhacks.h ec_lcl.h ec_print.c
+eck_prn.o: ../../e_os.h ../../include/openssl/asn1.h
+eck_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+eck_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+eck_prn.o: ../../include/openssl/ec.h ../../include/openssl/err.h
+eck_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
+eck_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+eck_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
+eck_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
+eck_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+eck_prn.o: ../cryptlib.h eck_prn.c
 ecp_mont.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 ecp_mont.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
 ecp_mont.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
index e21221868fa5ea949f783212526eee96a14f8c6e..da437faf2bfe43ce19152817d6e38c83f14dd514 100644 (file)
@@ -538,8 +538,10 @@ static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
 EVP_PKEY_ASN1_METHOD eckey_asn1_meth = 
        {
        EVP_PKEY_EC,
+       EVP_PKEY_EC,
        0,
-       0,
+       "ec",
+       "OpenSSL EC algorithm",
 
        eckey_pub_decode,
        eckey_pub_encode,
index 9badc7d6eea4ff87aec77a86b0d371ee94d8ca75..310fff425778e07dd054f0da0aa9bdf3a13e25f9 100644 (file)
@@ -354,9 +354,8 @@ evp_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 evp_pbe.o: ../cryptlib.h evp_pbe.c
 evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
-evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
-evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
-evp_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
+evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 evp_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 evp_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
@@ -364,10 +363,10 @@ evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 evp_pkey.o: ../../include/openssl/opensslconf.h
 evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
-evp_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
-evp_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
-evp_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
-evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pkey.c
+evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
+evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+evp_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
+evp_pkey.o: ../asn1/asn1_locl.h ../cryptlib.h evp_pkey.c
 m_dss.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 m_dss.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
@@ -596,7 +595,8 @@ p_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 p_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 p_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 p_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
-p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_lib.c
+p_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
+p_lib.o: p_lib.c
 p_open.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 p_open.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 p_open.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
index ab2a1e593f0f3370f6bb9e362dcd82780ec951ca..62f332092355347b746ffd392306d72092f7f8c0 100644 (file)
@@ -856,6 +856,28 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
 void EVP_PBE_cleanup(void);
 
 const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(int type);
+int EVP_PKEY_asn1_add(const EVP_PKEY_ASN1_METHOD *ameth);
+EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
+                                       const char *pem_str, const char *info);
+void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
+void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
+               int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf),
+               int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk),
+               int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
+                                                       ASN1_PCTX *pctx));
+void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
+               int (*param_decode)(const EVP_PKEY *pk, X509_PUBKEY *pub),
+               int (*param_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk),
+               int (*param_missing)(const EVP_PKEY *pk),
+               int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from),
+               int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
+               int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
+                                                       ASN1_PCTX *pctx));
+void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
+               void (*pkey_free)(EVP_PKEY *pkey));
+void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
+               void (*pkey_ctrl)(EVP_PKEY *pkey, int op,
+                                                       long arg1, void *arg2));
 
 /* BEGIN ERROR CODES */
 /* The following lines are auto generated by the script mkerr.pl. Any changes
index 7cfc2f3e0a852b29b4e1d970ec03bdcb73816bc8..beb40d7f328d7467404391874f40eed17314eea1 100644 (file)
@@ -57,6 +57,7 @@
  */
 
 #include <stdio.h>
+#include <ctype.h>
 #include "cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
@@ -776,3 +777,24 @@ err:
        BUF_MEM_free(dataB);
        return(0);
        }
+
+/* Check pem string and return prefix length.
+ * If for example the pem_str == "RSA PRIVATE KEY" and suffix = "PRIVATE KEY"
+ * the return value is 3 for the string "RSA".
+ */
+
+int pem_check_suffix(char *pem_str, char *suffix)
+       {
+       int pem_len = strlen(pem_str);
+       int suffix_len = strlen(suffix);
+       char *p;
+       if (suffix_len + 1 >= pem_len)
+               return 0;
+       if (strcmp(pem_str - suffix_len, suffix))
+               return 0;
+       p = pem_str - suffix_len - 1;
+       if (*p != ' ')
+               return 0;
+       return p - pem_str;
+       }
+
index dacdf114f767213d1c64f2e7986ccd378ef95602..9f833b09e5a28fc8f817975f8934fef34f9faa71 100644 (file)
@@ -78,6 +78,21 @@ clean:
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
+rsa_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
+rsa_ameth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
+rsa_ameth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
+rsa_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
+rsa_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
+rsa_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+rsa_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+rsa_ameth.o: ../../include/openssl/objects.h
+rsa_ameth.o: ../../include/openssl/opensslconf.h
+rsa_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+rsa_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
+rsa_ameth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
+rsa_ameth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+rsa_ameth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
+rsa_ameth.o: ../asn1/asn1_locl.h ../cryptlib.h rsa_ameth.c
 rsa_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
 rsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -179,6 +194,16 @@ rsa_pk1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 rsa_pk1.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
 rsa_pk1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pk1.c
+rsa_prn.o: ../../e_os.h ../../include/openssl/asn1.h
+rsa_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+rsa_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+rsa_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+rsa_prn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+rsa_prn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
+rsa_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+rsa_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
+rsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+rsa_prn.o: ../cryptlib.h rsa_prn.c
 rsa_pss.o: ../../e_os.h ../../include/openssl/asn1.h
 rsa_pss.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 rsa_pss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
index dc32a5cd31e7b4e5bbfa5bbc3376e04387d76909..0b3a9d057d806a111b325c8aaa100021bcb44387 100644 (file)
@@ -256,6 +256,9 @@ const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] =
                EVP_PKEY_RSA,
                0,
 
+               "rsa",
+               "OpenSSL RSA method",
+
                rsa_pub_decode,
                rsa_pub_encode,
                rsa_pub_cmp,