History log of /openbsd-current/lib/libcrypto/asn1/a_strnid.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.31 02-Mar-2024 tb

Remove ASN1_STRING_TABLE_{add,cleanup}

This was API for the ASN1_STRING_TABLE extensibility which has been
neutered for months and was completely unused in the ecosystem.

ok jsing


# 1.30 02-Mar-2024 tb

const correct ASN1_STRING_TABLE_get()

The ability of modifying the ASN1_STRING_TABLE was removed and the table
is now static. Stop casting away const. The only consumer, security/xca,
is already fixed.

ok jsing


# 1.29 16-Dec-2023 tb

Annotate incorrect value for ub_email_address

The ub_email_address upper bound, 128, returned for NID_pkcs9_emailAddress,
doesn't match the PKCS#9 specification where it is 255. This was adjusted
in RFC 5280:

The ASN.1 modules in Appendix A are unchanged from RFC 3280, except
that ub-emailaddress-length was changed from 128 to 255 in order to
align with PKCS #9 [RFC2985].

Nobody seems to have noticed so far, so leave it at an XXX and a BUGS
entry for now. It also clearly has the wrong name.

Another mystery is why the RFCs suffix some upper bounds with length, but
not others. Also, OpenSSL chose to be inconsistent with that, because
inconsistency is one of the few things this library is really good at.


# 1.28 16-Dec-2023 tb

Neuter the ASN1_STRING_TABLE modification API

This is complete nonsense that nothing's ever used except for a test by
schwarze. It will be removed in the next major bump. What remains could
be moved to a simple lookup table in security/xca...

ok jsing


Revision tags: OPENBSD_7_4_BASE
# 1.27 05-Jul-2023 beck

Hide symbols in asn1 and bio

ok jsing@


# 1.26 02-Jul-2023 tb

Convert some tables to C99 initializers

ok & "happy pirate day" beck


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.25 13-Dec-2021 schwarze

this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@


# 1.24 13-Dec-2021 schwarze

Catch integer overflow rather than silently truncating while
parsing MASK: strings in ASN1_STRING_set_default_mask_asc(3).
Issue noticed by tb@, patch by me, two additional #include lines from tb@.
OK tb@.


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


# 1.29 16-Dec-2023 tb

Annotate incorrect value for ub_email_address

The ub_email_address upper bound, 128, returned for NID_pkcs9_emailAddress,
doesn't match the PKCS#9 specification where it is 255. This was adjusted
in RFC 5280:

The ASN.1 modules in Appendix A are unchanged from RFC 3280, except
that ub-emailaddress-length was changed from 128 to 255 in order to
align with PKCS #9 [RFC2985].

Nobody seems to have noticed so far, so leave it at an XXX and a BUGS
entry for now. It also clearly has the wrong name.

Another mystery is why the RFCs suffix some upper bounds with length, but
not others. Also, OpenSSL chose to be inconsistent with that, because
inconsistency is one of the few things this library is really good at.


# 1.28 16-Dec-2023 tb

Neuter the ASN1_STRING_TABLE modification API

This is complete nonsense that nothing's ever used except for a test by
schwarze. It will be removed in the next major bump. What remains could
be moved to a simple lookup table in security/xca...

ok jsing


Revision tags: OPENBSD_7_4_BASE
# 1.27 05-Jul-2023 beck

Hide symbols in asn1 and bio

ok jsing@


# 1.26 02-Jul-2023 tb

Convert some tables to C99 initializers

ok & "happy pirate day" beck


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.25 13-Dec-2021 schwarze

this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@


# 1.24 13-Dec-2021 schwarze

Catch integer overflow rather than silently truncating while
parsing MASK: strings in ASN1_STRING_set_default_mask_asc(3).
Issue noticed by tb@, patch by me, two additional #include lines from tb@.
OK tb@.


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


# 1.27 05-Jul-2023 beck

Hide symbols in asn1 and bio

ok jsing@


# 1.26 02-Jul-2023 tb

Convert some tables to C99 initializers

ok & "happy pirate day" beck


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.25 13-Dec-2021 schwarze

this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@


# 1.24 13-Dec-2021 schwarze

Catch integer overflow rather than silently truncating while
parsing MASK: strings in ASN1_STRING_set_default_mask_asc(3).
Issue noticed by tb@, patch by me, two additional #include lines from tb@.
OK tb@.


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


# 1.26 02-Jul-2023 tb

Convert some tables to C99 initializers

ok & "happy pirate day" beck


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.25 13-Dec-2021 schwarze

this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@


# 1.24 13-Dec-2021 schwarze

Catch integer overflow rather than silently truncating while
parsing MASK: strings in ASN1_STRING_set_default_mask_asc(3).
Issue noticed by tb@, patch by me, two additional #include lines from tb@.
OK tb@.


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


# 1.25 13-Dec-2021 schwarze

this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@


# 1.24 13-Dec-2021 schwarze

Catch integer overflow rather than silently truncating while
parsing MASK: strings in ASN1_STRING_set_default_mask_asc(3).
Issue noticed by tb@, patch by me, two additional #include lines from tb@.
OK tb@.


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


# 1.23 11-Dec-2021 schwarze

Merge two bugfixes in ASN1_STRING_TABLE_add(3) and ASN1_STRING_TABLE_get(3)
from the OpenSSL 1.1.1 branch, which is still under a free license,
mostly this commit:

commit d35c0ff30b31be9fd5dcf3d552a16feb8de464bc
Author: Dr. Stephen Henson <steve@openssl.org>
Date: Fri Oct 19 15:06:31 2012 +0000
fix ASN1_STRING_TABLE_add so it can override existing string table values

This fixes a segfault in ASN1_STRING_TABLE_add(3), which tried to change a
static const entry when called with an nid already in the default table,
and it switches the precedence of the two tables in ASN1_STRING_TABLE_get(3).

In addition, it changes behaviour in the following minor ways:
* Ignore negative minsize and maxsize arguments, not just -1.
* Ignore a zero mask and zero flags.
It's unclear whether these additional changes make the API absolutely
better, but we want compatibility with OpenSSL in these functions.

Tweaks & OK tb@.


# 1.22 11-Dec-2021 schwarze

Merge the deletion of <ctype.h>, which isn't used here,
and some style improvements from the OpenSSL 1.1.1 branch,
which is still under a free license.
No functional change.
OK and additional tweaks tb@.


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.21 29-Jan-2017 beck

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@


# 1.20 21-Jan-2017 jsing

Expand DECLARE_OBJ_BSEARCH_CMP_FN and IMPLEMENT_OBJ_BSEARCH_CMP_FN macros.

No change to generated assembly excluding line numbers.


# 1.19 10-Feb-2015 jsing

Remove more IMPLEMENT_STACK_OF noops that have been hiding for the last
15 years.


# 1.18 28-Oct-2014 miod

Check the result of sk_*_push() operations for failure.
ok doug@ jsing@


# 1.17 11-Jul-2014 jsing

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@


# 1.16 10-Jul-2014 jsing

Stop including standard headers via cryptlib.h - pull in the headers that
are needed in the source files that actually require them.

ok beck@ miod@


# 1.15 22-Jun-2014 deraadt

nuke unused test programs; ok jsing


# 1.14 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.13 31-May-2014 beck

Change the actual default for returned asn1 strings to be utf8 in the code,
rather than only in the config file, to trip people up later.
Found, and fix pleaded for by <spider@skuggor.se> who apparently
spent hours chasing it down.
ok miod@


# 1.12 19-Apr-2014 jsing

More KNF.


# 1.11 18-Apr-2014 tedu

lob a few more knf grenades in here to soften things up.


# 1.10 17-Apr-2014 beck

Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free


# 1.9 03-Nov-2011 djm

openssl-1.0.0e: resolve conflicts


# 1.8 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.7 09-Jan-2009 djm

resolve conflicts


# 1.6 11-Nov-2003 markus

merge 0.9.7c; minor bugsfixes;
API addition: ERR_release_err_state_table
[make includes before you build libssl/libcrypto]


# 1.5 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


# 1.4 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.3 22-Jun-2001 beck

openssl-engine-0.9.6a merge


# 1.2 15-Dec-2000 beck

openssl-engine-0.9.6 merge


# 1.1 19-Mar-2000 beck

branches: 1.1.1;
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