Add algorithm specific signature printing. An individual ASN1 method can
[openssl.git] / crypto / dh / dh_ameth.c
index 7a83768e2c1872f11564417a3dda21e83f5428ec..02ec2d47b4bd39998fa2278f727c085403aa9e8e 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.
  */
 /* ====================================================================
@@ -60,6 +60,7 @@
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/dh.h>
+#include <openssl/bn.h>
 #include "asn1_locl.h"
 
 static void int_dh_free(EVP_PKEY *pkey)
@@ -117,7 +118,7 @@ static int dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
        return 1;
 
        err:
-       if (pubkey)
+       if (public_key)
                ASN1_INTEGER_free(public_key);
        if (dh)
                DH_free(dh);
@@ -287,7 +288,7 @@ err:
 
 static void update_buflen(const BIGNUM *b, size_t *pbuflen)
        {
-       int i;
+       size_t i;
        if (!b)
                return;
        if (*pbuflen < (i = (size_t)BN_num_bytes(b)))
@@ -381,7 +382,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent,
        if (0)
                {
 err:
-               DHerr(DH_F_DHPARAMS_PRINT,reason);
+               DHerr(DH_F_DO_DH_PRINT,reason);
                }
        if (m != NULL) OPENSSL_free(m);
        return(ret);
@@ -492,6 +493,7 @@ const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
        dh_copy_parameters,
        dh_cmp_parameters,
        dh_param_print,
+       0,
 
        int_dh_free,
        0