X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fi2d_s_pu.c;h=96e9ff595b5d062dc227c90e41b318ef512e2ae7;hp=bfa40f3e627b4a2a178e739edbdb1a6bdc4ae724;hb=66ebbb6a56bc1688fa37878e4feec985b0c260d7;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd diff --git a/crypto/asn1/i2d_s_pu.c b/crypto/asn1/i2d_s_pu.c index bfa40f3e62..96e9ff595b 100644 --- a/crypto/asn1/i2d_s_pu.c +++ b/crypto/asn1/i2d_s_pu.c @@ -56,18 +56,15 @@ * [including the GNU Public Licence.] */ +#ifndef NO_DSA #include #include "cryptlib.h" -#include "bn.h" -#include "dsa.h" -#include "objects.h" -#include "asn1_mac.h" +#include +#include +#include +#include -/* - * ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); - */ - -int i2d_DSAPublicKey(DSA *a, unsigned char **pp) +int i2d_DSAPublicKey(const DSA *a, unsigned char **pp) { BIGNUM *num[4]; ASN1_INTEGER bs; @@ -112,7 +109,7 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp) ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); bs.type=V_ASN1_INTEGER; - bs.data=(unsigned char *)Malloc(max+4); + bs.data=(unsigned char *)OPENSSL_malloc(max+4); if (bs.data == NULL) { ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ERR_R_MALLOC_FAILURE); @@ -124,8 +121,9 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + OPENSSL_free(bs.data); *pp=p; - return(t); + if(all) return(t); + else return(tot); } - +#endif