History log of /openbsd-current/lib/libcrypto/evp/e_rc2.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.29 09-Apr-2024 beck

Hide public symbols in evp.h

largely mechanically done by the guentherizer 9000

ok tb@


# 1.28 26-Mar-2024 tb

Unifdef PBE_PRF_TEST

This gets use of the last mention of EVP_CTRL_PBE_PRF_NID outside of evp.h

ok jsing


Revision tags: OPENBSD_7_5_BASE
# 1.27 07-Jan-2024 tb

Convert the remaining legacy ciphers to C99 initializers

No change in the generated aarch64 assembly apart from line number changes.

ok jsing


# 1.26 04-Jan-2024 tb

Remove unused app_data from EVP_CIPHER

The EVP_CIPHER structs are static const data that the library returns when
you call EVP_aes_128_cbc(), for example. It makes no sense whatsoever to
hang user data off such a struct, but it's been there since forever.

ok jsing


# 1.25 02-Dec-2023 tb

Revert a hunk of r1.23 that makes no sense

The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function
called here is EVP_CIPHER_CTX_key_length(). The result of the computation
is still correct, the check and local variable simply make no sense.


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.28 26-Mar-2024 tb

Unifdef PBE_PRF_TEST

This gets use of the last mention of EVP_CTRL_PBE_PRF_NID outside of evp.h

ok jsing


Revision tags: OPENBSD_7_5_BASE
# 1.27 07-Jan-2024 tb

Convert the remaining legacy ciphers to C99 initializers

No change in the generated aarch64 assembly apart from line number changes.

ok jsing


# 1.26 04-Jan-2024 tb

Remove unused app_data from EVP_CIPHER

The EVP_CIPHER structs are static const data that the library returns when
you call EVP_aes_128_cbc(), for example. It makes no sense whatsoever to
hang user data off such a struct, but it's been there since forever.

ok jsing


# 1.25 02-Dec-2023 tb

Revert a hunk of r1.23 that makes no sense

The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function
called here is EVP_CIPHER_CTX_key_length(). The result of the computation
is still correct, the check and local variable simply make no sense.


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.27 07-Jan-2024 tb

Convert the remaining legacy ciphers to C99 initializers

No change in the generated aarch64 assembly apart from line number changes.

ok jsing


# 1.26 04-Jan-2024 tb

Remove unused app_data from EVP_CIPHER

The EVP_CIPHER structs are static const data that the library returns when
you call EVP_aes_128_cbc(), for example. It makes no sense whatsoever to
hang user data off such a struct, but it's been there since forever.

ok jsing


# 1.25 02-Dec-2023 tb

Revert a hunk of r1.23 that makes no sense

The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function
called here is EVP_CIPHER_CTX_key_length(). The result of the computation
is still correct, the check and local variable simply make no sense.


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.27 07-Jan-2024 tb

Convert the remaining legacy ciphers to C99 initializers

No change in the generated aarch64 assembly apart from line number changes.

ok jsing


# 1.26 04-Jan-2024 tb

Remove unused app_data from EVP_CIPHER

The EVP_CIPHER structs are static const data that the library returns when
you call EVP_aes_128_cbc(), for example. It makes no sense whatsoever to
hang user data off such a struct, but it's been there since forever.

ok jsing


# 1.25 02-Dec-2023 tb

Revert a hunk of r1.23 that makes no sense

The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function
called here is EVP_CIPHER_CTX_key_length(). The result of the computation
is still correct, the check and local variable simply make no sense.


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.25 02-Dec-2023 tb

Revert a hunk of r1.23 that makes no sense

The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function
called here is EVP_CIPHER_CTX_key_length(). The result of the computation
is still correct, the check and local variable simply make no sense.


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.24 18-Nov-2023 tb

Forgot to fix one unsigned int vs int confusion

CID 468015


# 1.23 18-Nov-2023 tb

Check for negative IV length

A recent change in EVP_CIPHER_CTX_iv_length() made it possible in principle
that this function returns -1. This can only happen for an incorrectly set
up EVP_CIPHER. Still it is better form to check for negative lengths before
stuffing it into a memcpy().

It would probably be desirable to cap the iv_length to something large
enough. This can be done another time.

ok beck


Revision tags: OPENBSD_7_4_BASE
# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.22 07-Jul-2023 beck

Unbreak the namespace build after a broken mk.conf and tool misfire had
me aliasing symbols not in the headers I was procesing.

This unbreaks the namespace build so it will pass again

ok tb@


# 1.21 07-Jul-2023 beck

Hide symbols in hkdf, evp, err, ecdsa, and ec

(part 2 of commit)

ok jsing@


Revision tags: OPENBSD_7_3_BASE
# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.20 26-Nov-2022 tb

Make internal header file names consistent

Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names
used for internal headers. Move all these headers we inherited from
OpenSSL to *_local.h, reserving the name *_internal.h for our own code.
Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h.
constant_time_locl.h is moved to constant_time.h since it's special.

Adjust all .c files in libcrypto, libssl and regress.

The diff is mechanical with the exception of tls13_quic.c, where
#include <ssl_locl.h> was fixed manually.

discussed with jsing,
no objection bcook


Revision tags: OPENBSD_7_2_BASE
# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.19 15-Sep-2022 jsing

Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.18 10-Sep-2022 jsing

Use correct length for EVP CFB mode ciphers.

The BLOCK_CIPHER_* macros contained a bug where the total length is passed
to the underlying cipher implementation, rather than the length of the
current chunk. Correct this and use the chunk length instead.

Should address the remaining issues reported by Coverity.

ok tb@


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.17 04-Sep-2022 jsing

Add bounds checks for various EVP cipher implementations.

The EVP cipher API uses size_t, however a number of the underlying
implementations use long in their API. This means that an input with
size > LONG_MAX will go negative.

Found by Coverity, hiding under a large pile of macros.

ok tb@


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.16 04-Sep-2022 jsing

Remove dead code.

Only change to generated assembly is due to line numbers.


# 1.15 03-Sep-2022 jsing

Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.

Only change to generated assembly is due to EVPerror()'s use of line
numbers.
CVS ----------------------------------------------------------------------


Revision tags: OPENBSD_7_1_BASE
# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


# 1.14 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_ctrl

suggestion from tb@


# 1.13 20-Jan-2022 inoguchi

Add check for EVP_CIPHER_CTX_set_key_length return value

CID 21653

ok jsing@ millert@ 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.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.12 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.11 10-Feb-2015 miod

Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@


# 1.10 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.9 10-Jul-2014 jsing

Explicitly include <openssl/opensslconf.h> in every file that references
an OPENSSL_NO_* define. This avoids relying on something else pulling it
in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is
never going to do anything, since OPENSSL_NO_XYZ will never defined, due
to the fact that opensslconf.h has not been included.

This also includes some miscellaneous sorting/tidying of headers.


# 1.8 12-Jun-2014 deraadt

tags as requested by miod and tedu


# 1.7 08-May-2014 jsing

KNF.


# 1.6 13-Oct-2012 djm

resolve conflicts


# 1.5 01-Oct-2010 djm

resolve conflicts, fix local changes


# 1.4 06-Sep-2008 djm

resolve conflicts


# 1.3 12-May-2003 markus

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


# 1.2 15-May-2002 beck

OpenSSL 0.9.7 stable 2002 05 08 merge


# 1.1 15-Dec-2000 beck

branches: 1.1.1;
openssl-engine-0.9.6 merge