Use public domain snprintf() implementation by Patrick Powell to avoid
[oweals/openssl.git] / crypto / asn1 / x_sig.c
index f9c2a57c0046d6dc09168536009911f0fea03b21..3559bd536853dbdc7e1c1d357c68c8e27da25e42 100644 (file)
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/asn1_mac.h>
-
-/*
- * ASN1err(ASN1_F_D2I_X509_SIG,ERR_R_ASN1_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_X509_SIG_NEW,ERR_R_ASN1_LENGTH_MISMATCH);
- */
+#include <openssl/x509.h>
 
 int i2d_X509_SIG(X509_SIG *a, unsigned char **pp)
        {
@@ -98,7 +94,7 @@ X509_SIG *X509_SIG_new(void)
 
        M_ASN1_New_Malloc(ret,X509_SIG);
        M_ASN1_New(ret->algor,X509_ALGOR_new);
-       M_ASN1_New(ret->digest,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->digest,M_ASN1_OCTET_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_SIG_NEW);
        }
@@ -107,8 +103,8 @@ void X509_SIG_free(X509_SIG *a)
        {
        if (a == NULL) return;
        X509_ALGOR_free(a->algor);
-       ASN1_OCTET_STRING_free(a->digest);
-       Free((char *)a);
+       M_ASN1_OCTET_STRING_free(a->digest);
+       Free(a);
        }