summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_sign.c
diff options
context:
space:
mode:
authorbeck <>2000-03-19 11:13:58 +0000
committerbeck <>2000-03-19 11:13:58 +0000
commit796d609550df3a33fc11468741c5d2f6d3df4c11 (patch)
tree6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/asn1/a_sign.c
parent5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff)
downloadopenbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
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 }