Skip to content

Commit e7b08fa

Browse files
committed
Clean up SM state serialization
* Refactor `xmpp_sm_state_restore()` Add new internal functions to load u32 and string values. This also brings length checks in order to verify we don't read more sm_state than there potentially is and type checks to ensure we have the correct CBOR types. Each element is added to the queue right after creation, so it won't leak in case creating its content fails. * Refactor `sm_state_serialize()` * Store & restore ints as/from big endian, CBOR requires that * Bring API names in line with the usual naming * Auto-format sources Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent f3fa9f5 commit e7b08fa

File tree

4 files changed

+231
-178
lines changed

4 files changed

+231
-178
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ tests/test_resolver
6565
tests/test_sasl
6666
tests/test_scram
6767
tests/test_send_queue
68+
tests/test_serialize_sm
6869
tests/test_sha1
6970
tests/test_sha256
7071
tests/test_sha512

0 commit comments

Comments
 (0)