diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/asn1/a_sign.c | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/asn1/a_sign.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_sign.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c index 02188e68c4..57595692e5 100644 --- a/src/lib/libcrypto/asn1/a_sign.c +++ b/src/lib/libcrypto/asn1/a_sign.c | |||
@@ -62,21 +62,15 @@ | |||
62 | #include <sys/stat.h> | 62 | #include <sys/stat.h> |
63 | 63 | ||
64 | #include "cryptlib.h" | 64 | #include "cryptlib.h" |
65 | #include "bn.h" | 65 | #include <openssl/bn.h> |
66 | #include "evp.h" | 66 | #include <openssl/evp.h> |
67 | #include "x509.h" | 67 | #include <openssl/x509.h> |
68 | #include "objects.h" | 68 | #include <openssl/objects.h> |
69 | #include "buffer.h" | 69 | #include <openssl/buffer.h> |
70 | #include "pem.h" | ||
71 | 70 | ||
72 | int ASN1_sign(i2d,algor1,algor2,signature,data,pkey,type) | 71 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, |
73 | int (*i2d)(); | 72 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, |
74 | X509_ALGOR *algor1; | 73 | const EVP_MD *type) |
75 | X509_ALGOR *algor2; | ||
76 | ASN1_BIT_STRING *signature; | ||
77 | char *data; | ||
78 | EVP_PKEY *pkey; | ||
79 | EVP_MD *type; | ||
80 | { | 74 | { |
81 | EVP_MD_CTX ctx; | 75 | EVP_MD_CTX ctx; |
82 | unsigned char *p,*buf_in=NULL,*buf_out=NULL; | 76 | unsigned char *p,*buf_in=NULL,*buf_out=NULL; |
@@ -136,7 +130,11 @@ EVP_MD *type; | |||
136 | signature->data=buf_out; | 130 | signature->data=buf_out; |
137 | buf_out=NULL; | 131 | buf_out=NULL; |
138 | signature->length=outl; | 132 | signature->length=outl; |
139 | 133 | /* In the interests of compatability, I'll make sure that | |
134 | * the bit string has a 'not-used bits' value of 0 | ||
135 | */ | ||
136 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | ||
137 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | ||
140 | err: | 138 | err: |
141 | memset(&ctx,0,sizeof(ctx)); | 139 | memset(&ctx,0,sizeof(ctx)); |
142 | if (buf_in != NULL) | 140 | if (buf_in != NULL) |