Constify DH-related code.
[openssl.git] / crypto / asn1 / d2i_dhp.c
index f76a9d4423cd8083bdfd068ce328ea95c7b6d57f..d64ec746ce3136e1d8ee9eedbdc8e11723fb87df 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#ifndef NO_DH
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/objects.h>
 #include <openssl/asn1_mac.h>
 
-/*
- * ASN1err(ASN1_F_D2I_DHPARAMS,ERR_R_ASN1_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_I2D_DHPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
- */
-
-DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
+DH *d2i_DHparams(DH **a, const unsigned char **pp, long length)
        {
        int i=ERR_R_NESTED_ASN1_ERROR;
        ASN1_INTEGER *bs=NULL;
@@ -90,7 +86,7 @@ DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
                ret->length=(int)v;
                }
 
-       ASN1_BIT_STRING_free(bs);
+       M_ASN1_BIT_STRING_free(bs);
 
        M_ASN1_D2I_Finish_2(a);
 
@@ -99,7 +95,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_DHPARAMS,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DH_free(ret);
-       if (bs != NULL) ASN1_BIT_STRING_free(bs);
+       if (bs != NULL) M_ASN1_BIT_STRING_free(bs);
        return(NULL);
        }
-
+#endif