Check it actually compiles this time ;-)
[openssl.git] / crypto / asn1 / ameth_lib.c
index fee7198b85ad6b836ba76f60c0ac6ecc851ca9bd..9a8b6cc22264f6f35ffef862e9d389ea1204f4db 100644 (file)
@@ -1,4 +1,4 @@
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 2006.
  */
 /* ====================================================================
@@ -113,7 +113,7 @@ void main()
 #endif
 
 DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
-                          const EVP_PKEY_ASN1_METHOD *, ameth_cmp);
+                          const EVP_PKEY_ASN1_METHOD *, ameth);
 
 static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a,
                     const EVP_PKEY_ASN1_METHOD * const *b)
@@ -122,7 +122,7 @@ static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a,
        }
 
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
-                            const EVP_PKEY_ASN1_METHOD *, ameth_cmp);
+                            const EVP_PKEY_ASN1_METHOD *, ameth);
 
 int EVP_PKEY_asn1_get_count(void)
        {
@@ -155,11 +155,9 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
                if (idx >= 0)
                        return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
                }
-       ret = OBJ_bsearch(const EVP_PKEY_ASN1_METHOD *, &t,
-                         const EVP_PKEY_ASN1_METHOD *, standard_methods,
+       ret = OBJ_bsearch_ameth(&t, standard_methods,
                          sizeof(standard_methods)
-                         /sizeof(EVP_PKEY_ASN1_METHOD *),
-                         ameth_cmp);
+                         /sizeof(EVP_PKEY_ASN1_METHOD *));
        if (!ret || !*ret)
                return NULL;
        return *ret;
@@ -303,6 +301,8 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
                if (!ameth->info)
                        goto err;
                }
+       else
+               ameth->info = NULL;
 
        if (pem_str)
                {
@@ -310,6 +310,8 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
                if (!ameth->pem_str)
                        goto err;
                }
+       else
+               ameth->pem_str = NULL;
 
        ameth->pub_decode = 0;
        ameth->pub_encode = 0;