History log of /openbsd-src/lib/libcrypto/asn1/asn1_lib.c (Results 1 – 25 of 54)
Revision Date Author Comments
# 47fd635d 05-May-2022 jsing <jsing@openbsd.org>

Use size_t for ASN.1 lengths.

Change asn1_get_length_cbs() and asn1_get_object_cbs() to handle and return
a length as a size_t rather than a uint32_t. This makes it simpler and less
error prone in t

Use size_t for ASN.1 lengths.

Change asn1_get_length_cbs() and asn1_get_object_cbs() to handle and return
a length as a size_t rather than a uint32_t. This makes it simpler and less
error prone in the callers.

Suggested by and ok tb@

show more ...


# 21ceecff 28-Apr-2022 jsing <jsing@openbsd.org>

Rewrite asn1_check_tlen() using CBS.

Rather than calling asn1_get_object_cbs(), call asn1_get_identifier_cbs(),
then immediately proceed with the tag number and tag class check. Only if
that succeed

Rewrite asn1_check_tlen() using CBS.

Rather than calling asn1_get_object_cbs(), call asn1_get_identifier_cbs(),
then immediately proceed with the tag number and tag class check. Only if
that succeeds (or it is not required) do we call asn1_get_length_cbs().
This avoids incurring the overhead of decoding the length in the case where
the tag number and tag class do not match.

While here rename asn1_check_tlen() to asn1_check_tag() - while we decode
the length, what we are normally checking is the tag number and tag class.
Also rename the arguments for readability. For now the argument types
and encoding remain unchanged.

ok inoguchi@ tb@

show more ...


# 0090c680 26-Mar-2022 jsing <jsing@openbsd.org>

Provide asn1_get_primitive()

This takes a CBS, gets the ASN.1 identifier and length, ensures the
resulting identifier is a valid primitive, then returns the tag number and
the content as a CBS.

ok

Provide asn1_get_primitive()

This takes a CBS, gets the ASN.1 identifier and length, ensures the
resulting identifier is a valid primitive, then returns the tag number and
the content as a CBS.

ok inoguchi@ tb@

show more ...


# 9a10effc 25-Dec-2021 jsing <jsing@openbsd.org>

Rewrite ASN.1 identifier/length parsing in CBS.

Provide internal asn1_get_identifier_cbs() and asn1_get_length_cbs()
functions that are called from asn1_get_object_cbs(). Convert the existing
ASN1_g

Rewrite ASN.1 identifier/length parsing in CBS.

Provide internal asn1_get_identifier_cbs() and asn1_get_length_cbs()
functions that are called from asn1_get_object_cbs(). Convert the existing
ASN1_get_object() function so that it calls asn1_get_object_cbs(), before
mapping the result into the API that it implements.

ok tb@

show more ...


# 9bf539a0 15-Dec-2021 jsing <jsing@openbsd.org>

Rename asn1_lib.c to asn1_old_lib.c

This will allow us to add a new asn1_lib.c while replacing the code that is
in currently in asn1_old_lib.c.

Discussed with tb@


# e77f3548 15-Dec-2021 jsing <jsing@openbsd.org>

Consolidate various ASN.1 code.

Rather than having multiple files per type (with minimal code per file),
use one file per type (a_<type>.c).

No functional change.

Discussed with tb@


# ce3d60d3 03-Dec-2021 jsing <jsing@openbsd.org>

Rewrite ASN1_STRING_cmp().

This removes nested ifs and uses more sensible variable names.

ok schwarze@ tb@


# a059a1e0 03-Dec-2021 jsing <jsing@openbsd.org>

Convert ASN1_STRING_type_new() to calloc().

Rather than using malloc() and then initialising all struct members, use
calloc() and only initialise the single non-zero value member.

ok schwarze@ tb@


# feb138ef 13-Nov-2021 schwarze <schwarze@openbsd.org>

Fix a nasty quirk in ASN1_STRING_copy(3).
In case of failure, it reported the failure
but corrupted the type of the destination string.
Instead, let's make sure that in case of failure,
existing obje

Fix a nasty quirk in ASN1_STRING_copy(3).
In case of failure, it reported the failure
but corrupted the type of the destination string.
Instead, let's make sure that in case of failure,
existing objects remain in their original state.

OK tb@

show more ...


# bb15212c 08-Dec-2020 tb <tb@openbsd.org>

Fix a NULL dereference in GENERAL_NAME_cmp()

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
con

Fix a NULL dereference in GENERAL_NAME_cmp()

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

show more ...


# 49f0a416 17-Nov-2018 tb <tb@openbsd.org>

Fix whitespace around assignment operators.


# 332d495c 02-Nov-2018 tb <tb@openbsd.org>

whitespace


# 261db206 24-Oct-2018 jsing <jsing@openbsd.org>

Remove a bunch of ancient and highly crufty ASN.1 related code from
libcrypto (the "new" stuff replaced this back around 2000 or so...).

ok tb@


# 9b3891c7 25-Apr-2018 tb <tb@openbsd.org>

Add const to functions in asn1/asn1.h as they did in OpenSSL.
BIO_f_asn1() will be taken care of later.

Tested in a bulk by sthen
ok bcook jca jsing


# 613b392e 14-Feb-2018 jsing <jsing@openbsd.org>

Provide ASN1_STRING_get0_data().


# 7de8a684 02-May-2017 deraadt <deraadt@openbsd.org>

use freezero() instead of memset/explicit_bzero + free. Substantially
reduces conditional logic (-218, +82).

MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c
wasn'tt quite

use freezero() instead of memset/explicit_bzero + free. Substantially
reduces conditional logic (-218, +82).

MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c
wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and
BN_FLG_STATIC_DATA where the condition cannot be collapsed completely.

Passes regress. ok beck

show more ...


# 5067ae9f 29-Jan-2017 beck <beck@openbsd.org>

Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@


# a1178666 06-Mar-2016 beck <beck@openbsd.org>

explict_bzero for some asn1 free's - ok miod@


# 215c34c6 29-Jul-2015 jsing <jsing@openbsd.org>

Expand obsolete M_ASN1_STRING_* macros in asn1_lib.c, apply some style(9)
and drop an unnecessary return from a void function.

ok bcook@ doug@


# c75fc219 27-Jul-2015 jsing <jsing@openbsd.org>

Less asn1_mac.h - asn1_lib.c does not need it and x_pkey.c should be
using ASN1err() instead of ASN1_MAC_H_err().

ok miod@


# b6afe240 07-Feb-2015 miod <miod@openbsd.org>

Don't leak addresses in error messages.


# 700744f6 07-Feb-2015 doug <doug@openbsd.org>

Delete a lot of #if 0 code in libressl.

There are a few instances where #if 1 is removed but the code remains.

Based on the following OpenSSL commits. Some of the commits weren't
strictly deletion

Delete a lot of #if 0 code in libressl.

There are a few instances where #if 1 is removed but the code remains.

Based on the following OpenSSL commits. Some of the commits weren't
strictly deletions so they are going to be split up into separate commits.

6f91b017bbb7140f816721141ac156d1b828a6b3
3d47c1d331fdc7574d2275cda1a630ccdb624b08
dfb56425b68314b2b57e17c82c1df42e7a015132
c8fa2356a00cbaada8963f739e5570298311a060
f16a64d11f55c01f56baa62ebf1dec7f8fe718cb
9ccc00ef6ea65567622e40c49aca43f2c6d79cdb
02a938c953b3e1ced71d9a832de1618f907eb96d
75d0ebef2aef7a2c77b27575b8da898e22f3ccd5
d6fbb194095312f4722c81c9362dbd0de66cb656
6f1a93ad111c7dfe36a09a976c4c009079b19ea1
1a5adcfb5edfe23908b350f8757df405b0f5f71f
8de24b792743d11e1d5a0dcd336a49368750c577
a2b18e657ea1a932d125154f4e13ab2258796d90
8e964419603d2478dfb391c66e7ccb2dcc9776b4
32dfde107636ac9bc62a5b3233fe2a54dbc27008

input + ok jsing@, miod@, tedu@

show more ...


# 13f27b8c 11-Jul-2014 miod <miod@openbsd.org>

In ASN1_get_object(), reject primitive encodings using the indefinite length
constructed form. OpenSSL PR #2438 via OpenSSL trunk


# 030ec314 11-Jul-2014 miod <miod@openbsd.org>

In asn1_get_length(), tolerate leading zeroes in BER encoding.
OpenSSL PR #2746 via OpenSSL trunk


# b6ab114e 11-Jul-2014 jsing <jsing@openbsd.org>

Only import cryptlib.h in the four source files that actually need it.
Remove the openssl public includes from cryptlib.h and add a small number
of includes into the source files that actually need t

Only import cryptlib.h in the four source files that actually need it.
Remove the openssl public includes from cryptlib.h and add a small number
of includes into the source files that actually need them. While here,
also sort/group/tidy the includes.

ok beck@ miod@

show more ...


123