summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_sign.c')
-rw-r--r--src/lib/libcrypto/asn1/a_sign.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c
index 57595692e5..cfb4bca4f1 100644
--- a/src/lib/libcrypto/asn1/a_sign.c
+++ b/src/lib/libcrypto/asn1/a_sign.c
@@ -58,10 +58,13 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <time.h> 60#include <time.h>
61#include <sys/types.h>
62#include <sys/stat.h>
63 61
64#include "cryptlib.h" 62#include "cryptlib.h"
63
64#ifndef NO_SYS_TYPES_H
65# include <sys/types.h>
66#endif
67
65#include <openssl/bn.h> 68#include <openssl/bn.h>
66#include <openssl/evp.h> 69#include <openssl/evp.h>
67#include <openssl/x509.h> 70#include <openssl/x509.h>
@@ -126,11 +129,11 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
126 ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); 129 ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB);
127 goto err; 130 goto err;
128 } 131 }
129 if (signature->data != NULL) Free((char *)signature->data); 132 if (signature->data != NULL) Free(signature->data);
130 signature->data=buf_out; 133 signature->data=buf_out;
131 buf_out=NULL; 134 buf_out=NULL;
132 signature->length=outl; 135 signature->length=outl;
133 /* In the interests of compatability, I'll make sure that 136 /* In the interests of compatibility, I'll make sure that
134 * the bit string has a 'not-used bits' value of 0 137 * the bit string has a 'not-used bits' value of 0
135 */ 138 */
136 signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); 139 signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
@@ -138,8 +141,8 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
138err: 141err:
139 memset(&ctx,0,sizeof(ctx)); 142 memset(&ctx,0,sizeof(ctx));
140 if (buf_in != NULL) 143 if (buf_in != NULL)
141 { memset((char *)buf_in,0,(unsigned int)inl); Free((char *)buf_in); } 144 { memset((char *)buf_in,0,(unsigned int)inl); Free(buf_in); }
142 if (buf_out != NULL) 145 if (buf_out != NULL)
143 { memset((char *)buf_out,0,outll); Free((char *)buf_out); } 146 { memset((char *)buf_out,0,outll); Free(buf_out); }
144 return(outl); 147 return(outl);
145 } 148 }