Revert the size_t modifications from HEAD that had led to more
[openssl.git] / crypto / asn1 / x_pkey.c
index 0c81558..8453618 100644 (file)
@@ -69,15 +69,15 @@ int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
        return(0);
        }
 
-X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, unsigned char **pp, long length)
+X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
        {
        int i;
        M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new);
 
        M_ASN1_D2I_Init();
        M_ASN1_D2I_start_sequence();
-       M_ASN1_D2I_get(ret->enc_algor,d2i_X509_ALGOR);
-       M_ASN1_D2I_get(ret->enc_pkey,d2i_ASN1_OCTET_STRING);
+       M_ASN1_D2I_get_x(X509_ALGOR,ret->enc_algor,d2i_X509_ALGOR);
+       M_ASN1_D2I_get_x(ASN1_OCTET_STRING,ret->enc_pkey,d2i_ASN1_OCTET_STRING);
 
        ret->cipher.cipher=EVP_get_cipherbyname(
                OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm)));
@@ -146,6 +146,6 @@ void X509_PKEY_free(X509_PKEY *x)
        if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
        if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey);
        if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey);
-       if ((x->key_data != NULL) && (x->key_free)) Free((char *)x->key_data);
-       Free((char *)(char *)x);
+       if ((x->key_data != NULL) && (x->key_free)) OPENSSL_free(x->key_data);
+       OPENSSL_free(x);
        }