Check getRemotePlainTextBlockSize for RSA key length failures and reject values <= 42 before subtracting the PKCS#1 v1.5 padding size. The previous code ignored the OpenSSL return value and subtracted unconditionally, which could wrap when key length retrieval failed or returned a too-small value.
Add a regression test that uses a zeroed fake channel context to exercise the failure path.
* feat(plugin): Add filestore Windows implementation
* Define UA_DT_REG and UA_DT_DIR
* Remove build flag and use __linux__ or UA_ARCHITECTURE_WIN32 in places which used to check only for __linux__
* feat(plugin): Add filestore backend security policies to support writing updated certificates back to the file system
* feat(tests): Add test cases for the filestore security policies and the updateCertificate function
---------
Co-authored-by: Julius Pfrommer <jpfr@users.noreply.github.com>
* Add null terminator before parsing certificates and keys
mbedTLS expects PEM data to be null terminated, the length
parameter must include the null terminator.
By adding the null terminator inside open62541, an application
doesn't have to care what type of certificate or key is used.
* Extend encryption tests
- Add test for security policy Basic256
- Add test with PEM encoded certificate and key
* Fix amalgamation build for ua_pki_default.c
Including securitypolicy_mbedtls_common.h is not possible because
it is added to the amalgamation after ua_pki_default.c