Ronald Cron
e31fd11ab3
psa: include: Fix comments
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-04-01 15:59:57 +02:00
Ronald Cron
56c9a9457a
psa: hash: Fix is_hash_accelerated signature
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-04-01 10:50:03 +02:00
Gilles Peskine
e93095fe6b
Merge pull request #4175 from mpg/expand-doc-visibility
...
Improve the visibility of some informations
2021-03-31 11:48:02 +02:00
Gilles Peskine
bf792e0a82
Merge pull request #3616 from militant-daos/bug_3175
...
Fix premature fopen() call in mbedtls_entropy_write_seed_file
2021-03-30 17:33:08 +02:00
Ronald Cron
17fbf5b3c4
Merge pull request #4237 from paul-elliott-arm/fix_printf_extra
...
Fix printf missed issues
2021-03-30 16:40:56 +02:00
Ronald Cron
48ffe622f9
Merge pull request #4215 from paul-elliott-arm/remove_fallthrough
...
Remove deliberate fallthrough
2021-03-30 16:40:24 +02:00
Ronald Cron
841ae226a4
Merge pull request #4019 from gilles-peskine-arm/etags-no-line-directive
...
TAGS: Fix lookup in test/suites/!(test_suite_*).function
2021-03-30 16:38:26 +02:00
paul-elliott-arm
f08ec01e2b
Merge pull request #4014 from hanno-arm/mps_reader
...
Add MPS reader component
2021-03-29 16:26:02 +01:00
Hanno Becker
ecb02fbbc5
Apply suggestions from code review
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
c0b1b252bc
Update tests/suites/test_suite_mps.function
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
5b3841d592
Fix uninitialized memory bug in MPS reader test
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
3c6386cde5
Revert accidental gitignore change
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
1b1e7eb611
Add unit test for integer overflow in mbedtls_mps_reader_reclaim()
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
d4d33a1b6b
Remove unnecessary check before calling memcpy()
...
This check was added earlier to avoid useless calls to `memcpy()`
with length `0` in the _frequent_ case where we're not accumulating.
By now, the whole code path has been moved to a branch which is only
executed if the reader is accumulating, and the only time this check
would be relevant is if we happen to feed an empty fragment to the
reader. In this case, the call to memcpy() could be removed, but
since this case is exceptional and the call to memcpy() is still
correct even for a length 0 copy, we remove the check for simplicity
of the code.
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
756abeb4e1
Fix typo in MPS test suite
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
d7fcbfa71e
Test paused
argument of MPS reader mbedtls_mps_reader_reclaim()
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
032b352684
Improve naming of local variables in MPS reader implementation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
00931492da
Fix spacing in MPS test suite
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
7594c68049
Document status of MPS upstreaming
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
43c8f8cf79
Put MPS under the umbrella of the TLS 1.3 experimental configuration
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
61d7eedcb5
Fix Doxygen headers for MPS files
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
2332f8f435
Rename static variable for MPS trace depth
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
15da2fcf81
Remove unnecessary parameter in MPS reader unit test
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
5047b56758
Improve wording in MPS unit tests
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
b17212a8bf
Use size_t instead of int for index in buffer loops in MPS unit test
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
8a04b10ed8
Fix include path for MPS reader header in MPS test suite
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
77e4f485e1
Move illustration of (un)supported cases in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
97c8e930e2
Fix diagram in documentation of MPS reader
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
1682a8b6fe
Don't use abbreviated names for local variables in MPS reader
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
b9c086adc5
Use int
pointer for paused
param in mbedtls_mps_reader_reclaim()
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
fea81b3997
Improve and fix wording in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
f1cfa319c4
Fix typos in documentation of MBEDTLS_ERR_MPS_READER_NEED_MORE
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
d913e2e982
Remove duplicate definition of MBEDTLS_MPS_ERR_BASE
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
4a079c5be7
Fix documentation for mbedtls_mps_[stored_]size_t
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
46101c76f9
Improve wording of documentation of mbedtls_mps_size_t
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
6e3484e123
Clarify documentation of MBEDTLS_MPS_STATE_VALIDATION
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
53314aade1
Adjust spacing for MPS reader entries in library/Makefile
...
Existing entries use combination of tabs and spaces, for whatever reason.
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
3d0db81690
Fix typo in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
8fc107c9fb
Clarify wording in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
a408c1719c
Clarify wording in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
49cc1317b0
Fix typo in MPS reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
b1855434eb
Rename mbedtls_mps_reader::acc_avail -> acc_available
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
f81e41f1e4
Improve readability of MPS reader implementation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
0bea62f2d7
Fix typo in reader documentation
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
4f84e20eb0
Don't invalidate MPS reader buffers upon commit call
...
Previously, the semantics of mbedtls_mps_reader_commit() was to invalidate
all buffers previously fetched via mbedtls_mps_reader_get(), forbidding
any further use by the 'consumer'. This was in fact a necessary constraint
for the current implementation, which did some memory moving in
mbedtls_mps_reader_commit().
This commit simplifies the reader's semantics and implementation in
the following way:
- API: A call to mbedtls_mps_reader_commit() does no longer invalidate
the buffers previously obtained via mbedtls_mps_reader_get().
Instead, they can continue to be used until
mbedtls_mps_reader_reclaim() is called.
Calling mbedtls_mps_reader_commit() now only sets a marker
indicating which parts of the data received through
mbedtls_mps_reader_get() need not be backed up once
mbedtls_mps_reader_reclaim() is called. Allowing the user
to call mbedtls_mbedtls_reader_commit() multiple times
before mbedtls_mps_reader_reclaim() is mere convenience:
We'd get exactly the same functionality if instead of
mbedtls_mps_reader_commit(), there was an additional argument
to mbedtls_mps_reader_reclaim() indicating how much data
to retain. However, the present design is more convenient
for the user and doesn't appear to introduce any unnecessary
complexity (anymore), so we stick with it for now.
- Implementation: mbedtls_mps_reader_commit() is now a 1-liner,
setting the 'commit-marker', but doing nothing else.
Instead, the complexity of mbedtls_mp_reader_reclaim()
slightly increases because it has to deal with creating
backups from both the accumulator and the current
fragment. In the previous implementation, which shifted
the accumulator content with every call to
mbedtls_mps_reader_commit(), only the backup from the
fragment was necessary; with the new implementation
which doesn't shift anything in
mbedtls_mps_reader_commit(), we need to do the
accumulator shift in mbedtls_mps_reader_reclaim().
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
014f683ca9
Test MPS reader when reclaim fails because the acc is too small
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
bc64f945e4
Update VS2010 project file
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:20:18 +01:00
Hanno Becker
8899396fd1
Move MPS reader to mbedtls_mps_ namespace
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:19:32 +01:00
Hanno Becker
984fbded58
Move MPS trace macros to MBEDTLS_MPS_ namespace
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:19:32 +01:00
Hanno Becker
c518c3b7bb
Rename MPS files library/mps/xxx.[ch] to library/mps_xxx.[ch]
...
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-03-29 14:19:32 +01:00