diff options
Diffstat (limited to 'crypto/openssl/crypto/asn1')
-rw-r--r-- | crypto/openssl/crypto/asn1/Makefile.ssl | 141 | ||||
-rw-r--r-- | crypto/openssl/crypto/asn1/a_bitstr.c | 1 | ||||
-rw-r--r-- | crypto/openssl/crypto/asn1/a_gentm.c | 2 | ||||
-rw-r--r-- | crypto/openssl/crypto/asn1/a_sign.c | 62 | ||||
-rw-r--r-- | crypto/openssl/crypto/asn1/a_time.c | 2 | ||||
-rw-r--r-- | crypto/openssl/crypto/asn1/a_utctm.c | 4 |
6 files changed, 136 insertions, 76 deletions
diff --git a/crypto/openssl/crypto/asn1/Makefile.ssl b/crypto/openssl/crypto/asn1/Makefile.ssl index 269af4459323..73ef4d2ca937 100644 --- a/crypto/openssl/crypto/asn1/Makefile.ssl +++ b/crypto/openssl/crypto/asn1/Makefile.ssl @@ -936,40 +936,40 @@ t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h -t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h +t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h +t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h +t_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h +t_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h +t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h +t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h +t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +t_bitst.o: ../cryptlib.h t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -t_crl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h -t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h +t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h +t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h +t_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h +t_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h +t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h +t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h +t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +t_crl.o: ../cryptlib.h t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h @@ -985,20 +985,20 @@ t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h -t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h +t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h +t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h +t_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h +t_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h +t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h +t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h +t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +t_req.o: ../cryptlib.h t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h @@ -1024,20 +1024,20 @@ t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h -t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h -t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h +t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h +t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h +t_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h +t_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h +t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h +t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h +t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +t_x509.o: ../cryptlib.h t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h @@ -1310,21 +1310,20 @@ x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h x_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h -x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h -x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h -x_x509.o: ../cryptlib.h +x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +x_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h +x_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +x_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +x_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h +x_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h diff --git a/crypto/openssl/crypto/asn1/a_bitstr.c b/crypto/openssl/crypto/asn1/a_bitstr.c index 7013a407ad68..cdedb29e4f50 100644 --- a/crypto/openssl/crypto/asn1/a_bitstr.c +++ b/crypto/openssl/crypto/asn1/a_bitstr.c @@ -224,6 +224,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) w=n/8; v=1<<(7-(n&0x07)); iv= ~v; + if (!value) v=0; a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ diff --git a/crypto/openssl/crypto/asn1/a_gentm.c b/crypto/openssl/crypto/asn1/a_gentm.c index 314479a03dad..b55f882b7638 100644 --- a/crypto/openssl/crypto/asn1/a_gentm.c +++ b/crypto/openssl/crypto/asn1/a_gentm.c @@ -203,7 +203,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, if (s == NULL) return(NULL); -#if defined(THREADS) && !defined(WIN32) +#if defined(THREADS) && !defined(WIN32) && ! defined(_DARWIN) gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ ts=&data; #else diff --git a/crypto/openssl/crypto/asn1/a_sign.c b/crypto/openssl/crypto/asn1/a_sign.c index 4c651706d2d6..94829d889e0d 100644 --- a/crypto/openssl/crypto/asn1/a_sign.c +++ b/crypto/openssl/crypto/asn1/a_sign.c @@ -55,6 +55,59 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ #include <stdio.h> #include <time.h> @@ -87,7 +140,14 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, else a=algor2; if (a == NULL) continue; - if ( (a->parameter == NULL) || + if (type->pkey_type == NID_dsaWithSHA1) + { + /* special case: RFC 2459 tells us to omit 'parameters' + * with id-dsa-with-sha1 */ + ASN1_TYPE_free(a->parameter); + a->parameter = NULL; + } + else if ((a->parameter == NULL) || (a->parameter->type != V_ASN1_NULL)) { ASN1_TYPE_free(a->parameter); diff --git a/crypto/openssl/crypto/asn1/a_time.c b/crypto/openssl/crypto/asn1/a_time.c index 8c0ddee4ac3e..17475e0f492c 100644 --- a/crypto/openssl/crypto/asn1/a_time.c +++ b/crypto/openssl/crypto/asn1/a_time.c @@ -113,7 +113,7 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length) ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) { struct tm *ts; -#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN) struct tm data; gmtime_r(&t,&data); diff --git a/crypto/openssl/crypto/asn1/a_utctm.c b/crypto/openssl/crypto/asn1/a_utctm.c index d381c9e0d1e6..3ae7432cb20a 100644 --- a/crypto/openssl/crypto/asn1/a_utctm.c +++ b/crypto/openssl/crypto/asn1/a_utctm.c @@ -203,7 +203,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) if (s == NULL) return(NULL); -#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN) gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ ts=&data; #else @@ -286,7 +286,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) t -= offset*60; /* FIXME: may overflow in extreme cases */ -#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN) { struct tm data; gmtime_r(&t, &data); tm = &data; } #else tm = gmtime(&t); |