18442 Commits

Author SHA1 Message Date
Mingjie Shen
f5b93c1e95 ssl_mail_client: Check return value of mbedtls_snprintf
The return value of snprintf() is the number of characters (excluding
the null terminator) which would have been written to the buffer if
enough space had been available. Thus, a return value of size or more
means the output was truncated.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2024-04-02 17:26:49 -04:00
Mingjie Shen
62d462a487 ssl_mail_client: Replace snprintf with mbedtls_snprintf
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2024-04-02 17:26:49 -04:00
Mingjie Shen
cfe1be3bee ssl_mail_client: Fix unbounded write of sprintf()
These calls to sprintf may overflow buf because opt.mail_from and opt.mail_to
are controlled by users. Fix by replacing sprintf with snprintf.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2024-03-06 22:28:52 +00:00
Gilles Peskine
5bc604f33c
Merge pull request #8873 from daverodgman/quietbuild-2.28
Make builds less verbose - 2.28 backport
2024-03-05 18:04:11 +00:00
Gilles Peskine
a19f6bfcad
Merge pull request #8823 from davidhorstmann-arm/fix-config-bitflag-2.28
[Backport 2.28] Update `SSL_SERIALIZED_SESSION_CONFIG_BITFLAG` with new flags
2024-03-05 13:17:43 +00:00
David Horstmann
fc8cacf9a2 Add missing config guards in comment
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-05 10:46:26 +00:00
Dave Rodgman
dff18da29a fix zlib test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-01 15:53:52 +00:00
David Horstmann
f5a6fa2e4a Fix code style
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:31:35 +00:00
David Horstmann
ec8a5b175e Add ChangeLog entry for ssl serialization bitflags
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:19:00 +00:00
David Horstmann
11def97472 Fix naming inconsistencies in config bits
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:15:56 +00:00
David Horstmann
363db7759a Add config guards to ssl session comment
Show which members of the session structure are dependent on
configuration options and which aren't.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:11:24 +00:00
Dave Rodgman
e264a7dcd1 Fix generate_visualc_files.pl
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 21:22:59 +00:00
Dave Rodgman
422f9bcea0 Fix formatting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 18:42:07 +00:00
Dave Rodgman
9f1003b381 blank line for readability
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 15:01:29 +00:00
Dave Rodgman
7a659102f5 Use export to set VERBOSE_LOGS
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:59:40 +00:00
Dave Rodgman
f4aa1ce006 Fix docs
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:14:53 +00:00
Dave Rodgman
c2a27492bc simplify printf call
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:13:35 +00:00
Dave Rodgman
b93ae3b453 improve docs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
03b232ae4e Add editor hint for emacs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
7c84471ed7 Rename quiet to quiet.sh
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
04e0f41f08 Send printed command to stderr
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
cdf57d1ddc remove trailing space from printed command
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
f57529903d Improve simplified quoting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
a8e671d7bb remove shebang from quiet
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
043325d191 Improve docs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
6122cb1013 Quote directory name from cmake wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
62ba696bae Undo not-needed change
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
e2317649dd Allow wrappers to be missing; quote directory name from make
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
0b069bd5b1 Avoid infinite loop
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
57783d7459 Extract common parts of quiet wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
6529f12d35 Tidy up quiet wrappers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
4cb98a930c Move quiet wrapper setup
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:48 +00:00
Dave Rodgman
634fe908b7 Improve quote_args output readability
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
d4a5563417 Improve output from make/cmake wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
59f9df999d Always display make/cmake invocation command
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
75da313166 Pacify check_files
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
8470d114e2 Spelling fix
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
a0b7c08b60 Use quiet make wrappers from all.sh
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:14 +00:00
Dave Rodgman
99fa0d08d3 Create quiet wrappers for make and cmake
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:09:58 +00:00
Manuel Pégourié-Gonnard
cb086af4bc
Merge pull request #8860 from gilles-peskine-arm/ecp-write-doc-2.28
Backport 2.28: Document ECP write functions
2024-02-28 11:04:27 +00:00
Gilles Peskine
9721b868a2 Allow null buffers when the length is 0
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 12:38:16 +01:00
Gilles Peskine
84dc44b9b5 Note that ecp read/write functions don't support Curve448 yet
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:05:45 +01:00
Gilles Peskine
7ce99c0f3a mbedtls_ecp_write_key: document that this function doesn't detect unset data
Fixes #8803.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:04:29 +01:00
Gilles Peskine
e65e98a1dc mbedtls_ecp_write_key: document and test smaller output buffer
Document and test the current behavior, even if it is weird:

* For Weierstrass keys, the error is MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL,
  not MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL.
* For Weierstrass keys, a smaller output buffer is ok if the output fits.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:02:44 +01:00
Gilles Peskine
75bb596de8 mbedtls_ecp_write_key: document and test larger output buffer
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:01:51 +01:00
Gilles Peskine
c2c74b9cef mbedtls_ecp_write_key: no FEATURE_UNAVAILABLE error
When exporting a key, MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE should not happen.
This error indicates that the curve is not supported, but that would prevent
the creation of the key.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 08:54:25 +01:00
Gilles Peskine
36e6bd6926
Merge pull request #8811 from gilles-peskine-arm/pk_import_into_psa-backports-2.28
Backport 2.28: bugs fixed in "Implement mbedtls_pk_import_into_psa"
2024-02-21 15:45:21 +00:00
Janos Follath
53e5adfca4
Merge pull request #8841 from BensonLiou/use_init_api-228
use mbedtls_ssl_session_init() to init session variable
2024-02-19 15:49:29 +00:00
Benson Liou
6805ff7892 use mbedtls_ssl_session_init() to init session variable
Use mbedtls_ssl_session_init() to init variable just like
session-family APIs described

Signed-off-by: Benson Liou <benson.liou@sony.com>
2024-02-17 00:19:10 +08:00
Gilles Peskine
049ea32931 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-15 15:32:47 +01:00