| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
When using the object reuse facility of c2i_ASN1_OBJECT, the dynamically
allocated strings a may contain are set to NULL, so we must free them
beforehand. Also clear the flag, because that's what OpenSSL chose to do.
From Richard Levitte OpenSSL 1.1.1 65b88a75921533ada8b465bc8d5c0817ad927947
ok inoguchi
|
|
|
|
| |
pointed out by jsing
|
|
|
|
|
|
|
|
|
|
|
| |
When parsing an UTCTime into a struct tm that wasn't cleared by the caller,
the years would be added to the already present value, which could give an
incorrect result. This is an issue in ASN1_UTCTIME_cmp_time_t(), which is
practically unused. Fix this by always zeroing the passed struct tm.
Issue reported by Olivier Taïbi, thanks!
ok jsing
|
|
|
|
|
|
|
|
|
|
|
|
| |
Comparing two GENERAL_NAME structures containing an EDIPARTYNAME can lead
to a crash. This enables a denial of service attack for an attacker who can
control both sides of the comparison.
Issue reported to OpenSSL on Nov 9 by David Benjamin.
OpenSSL shared the information with us on Dec 1st.
Fix from Matt Caswell (OpenSSL) with a few small tweaks.
ok jsing
|
|
|
|
|
|
|
|
|
|
| |
Instead of using malloc(3) and manually setting part of the structure to
zero, part to something else and leaving the rest uninitialized, we can
benefit from the fact that there's this thing called calloc(3).
Moreover, all variants of free(3) in libcrypto are NULL safe.
ok beck inoguchi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Zap a memset that was redundant since OpenSSL 0.97b was merged by
markus in 2003. Nowadays it's otto's recallocarray(3) that does the
zeroing.
ok beck inoguchi otto
PS: ASN1_BIT_STRING_set_bit(3) was committed on Dec 21 1998 by Ralf S.
Engelschnall and used this bizarre allocation idiom:
if (a->data == NULL)
c=(unsigned char *)Malloc(w+1);
else
c=(unsigned char *)Realloc(a->data,w+1);
People complained about Malloc, Realloc and Free being used elsewhere, so
on Jun 1 2000, Richarde Levitte swept the OpenSSL tree and it became this.
if (a->data == NULL)
c=(unsigned char *)OPENSSL_malloc(w+1);
else
c=(unsigned char *)OPENSSL_realloc(a->data,w+1);
Then it was found that existing data should be cleaned, and on Nov 13 2002
Ben Laurie changed the last line to
c=(unsigned char *)OPENSSL_realloc_clean(a->data,
a->length,
w+1);
|
|
|
|
|
|
|
|
|
|
|
| |
failure rather than silently constructing a broken X509_ATTRIBUTE object
that might cause NULL pointer accesses later on. This matters because
X509_ATTRIBUTE_create() is used by documented API functions like
PKCS7_add_attribute(3) and the NID comes straight from the user.
This fixes a bug found while working on documentation.
OK tb@ and "thanks" bluhm@
|
|
|
|
|
|
|
|
|
| |
bytes in case ASN1_INTEGER_get() failed. This happens more often since
asn1/a_int.c -r1.34. Matches OpenSSL behavior.
Issue in openssl x509 -text output reported by sthen
ok jsing sthen
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check and print out boolean type properly.
Based on OpenSSL commit ad72d9fdf7709ddb97a58d7d45d755e6e0504b96.
Reduced unneeded parentheses from if condition.
Check return value from i2s_ASN1_INTEGER.
Based on OpenSSL commit 5e3553c2de9a365479324b8ba8b998f0cce3e527.
Added if condition expression and return 0 if NULL is returned.
ok tb@
|
|
|
|
| |
ok tb@
|
|
|
|
| |
ok jsing@
|
|
|
|
| |
ok tb@
|
|
|
|
|
|
|
|
| |
These are internal only for now.
Based on OpenSSL 1.1.1d.
ok inoguchi@
|
|
|
|
| |
- Add static_ASN1_* macro. Patch was provided by steils AT gentoo.org
|
|
|
|
|
|
| |
fixes oss-fuzz #14558
ok beck jsing
|
|
|
|
|
|
|
|
| |
(same fix as in a_int.c rev 1.34)
Fixes oss-fuzz issue #13809
ok beck, jsing
|
|
|
|
|
|
| |
Fixes oss-fuzz issue #13804
ok beck, jsing
|
|
|
|
|
|
|
|
| |
minimum value.
Fixes oss-fuzz #14354.
ok beck@ bcook@ tb@
|
|
|
|
|
|
| |
Fixes oss-fuzz issue #13843.
ok tb@
|
|
|
|
|
|
|
|
|
|
|
| |
There are cases where the old_priv_decode() function can fail but consume
bytes. This will result in the pp pointer being advanced, which causes
d2i_PKCS8_PRIV_KEY_INFO() to be called with an advanced pointer and
incorrect length.
Fixes oss-fuzz #13803 and #14142.
ok deraadt@ tb@
|
|
|
|
|
|
|
|
|
|
|
| |
In this code, just because something is cast to a type doesn't mean it is
necessarily that type - in this case we cannot check the length of the
ASN1_STRING here, since it might be another data type and later handled
as an int (for example, in the V_ASN1_BOOLEAN case).
We will revisit this post release.
ok tb@
|
|
|
|
| |
ok beck@, tb@
|
|
|
|
|
|
|
| |
BIO_print() returns -1 on failure, whereas the ASN print functions need to
return 0.
ok beck@, tb@
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an ASN.1 item provides its own ASN1_PRIMITIVE_FUNCS functions, require
all functions to be provided (currently excluding prim_clear). This avoids
situations such as having a custom allocator that returns a specific struct
but then is then printed using the default primative print functions, which
interpret the memory as a different struct.
Found by oss-fuzz, fixes issue #13799.
ok beck@, tb@
|
| |
|
| |
|
|
|
|
| |
From phrocker via github.
|
|
|
|
|
| |
depth of 128 - For oss-fuzz issue 13802
ok jsing@
|
|
|
|
|
|
| |
sizes used remain a positive integer. Should address issue
13799 from oss-fuzz
ok tb@ jsing@
|
|
|
|
|
|
|
|
|
|
|
| |
mechanical M_ASN1 macro expansion. The ASN1_INTEGER_cmp function
takes signs into account while ASN1_STRING_cmp doesn't. The mixups
mostly involve serialNumbers, which, in principle, should be positive.
However, it is unclear whether that is checked or enforced anywhere
in the code, so these are probably bugs.
Patch from Holger Mikolon
ok jsing
|
|
|
|
|
|
| |
This prototype was removed inadvertantly in r1.50.
OK jsing@
|
| |
|
|
|
|
| |
From Ben L <bobsayshilol () live ! co ! uk>
|
|
|
|
|
| |
From Ben L bobsayshilol () live ! co ! uk
Similar fixes in BoringSSL and OpensSSL.
|
|
|
|
|
|
| |
From Ben L bobsayshilol () live ! co ! uk
ok jsing
|
|
|
|
|
|
| |
previous clean up.
Spotted by bcook@
|
| |
|
|
|
|
|
|
| |
libcrypto (the "new" stuff replaced this back around 2000 or so...).
ok tb@
|
|
|
|
|
|
|
| |
compiler warning by Pavel Kraynyukhov. A similar fix was made in
OpenSSL commit 369e93398b68b8a328e6c1d766222b.
ok inoguchi
|
| |
|
|
|
|
|
|
|
|
|
| |
Requires adding a const to the priv_decode() member of
EVP_PKEY_ASN1_METHOD and adjusting all *_priv_decode()
functions. All this is already documented this way.
tested in a bulk build by sthen
ok jsing
|
|
|
|
|
|
|
|
| |
we can add const to PKCS8_pkey_get0(). In order for this to work,
we need to sprinkle a few consts here and there.
tested in a bulk by sthen
ok jsing
|
|
|
|
|
|
|
|
|
|
|
| |
Provide PKCS8_pkey_add1_attr_by_NID() and PKCS8_pkey_get0_attrs().
Remove the whole broken code and simplify pkcs8_priv_key_info_st
accordingly. Based on OpenSSL commit
54dbf42398e23349b59f258a3dd60387bbc5ba13 plus some const that was
added later.
tested in a bulk build by sthen
ok jsing
|
|
|
|
|
|
| |
those that OpenSSL has had for ages.
ok jsing
|
|
|
|
|
| |
Found by Coverity.
Feedback and ok tb@
|
|
|
|
|
|
|
|
| |
to do it a second time by hand, badly. While here, do some style cleanup.
This incomplete list of function pointers appears in EVP_PKEY_asn1_copy()
as well, fix it by adding sig_print to the members copied over.
ok bcook
|
|
|
|
|
| |
tested in a bulk build by sthen
ok jsing
|
|
|
|
|
|
|
| |
X509_NAME_print{,_ex{,_fp}}(3).
tested in a bulk build by sthen
ok jsing
|
|
|
|
|
|
|
| |
Also place all of the OPENSSL_* memory related prototypes under #ifndef
LIBRESSL_INTERNAL.
ok beck@ tb@
|
|
|
|
|
| |
tested in a bulk build by sthen
ok beck (as part of a larger diff)
|