wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.25k stars 805 forks source link

Coverity fixes #7733

Closed SparkiDev closed 2 weeks ago

SparkiDev commented 2 weeks ago

Description

pk.c: EncryptDerKey - setting wrong ret value on allocation failure. wolfssl_rsa_generate_key_native - now checks e is a valid long before passing in. Fix formatting.

ssl_load.c: ProcessBufferPrivPkcs8Dec - now checking password is not NULL before zeroizing. Allocation may fail and ForceZero doesn't check for NULL. Fix formatting.

tests/api.c: test_RsaSigFailure_cm - Check cert_sz is greater than zero before use. send_new_session_ticket - assert that building the message doesn't return error or 0. test_ticket_nonce_malloc - fix setting of medium and big to use preprocessor. Fix big to be medium + 20.

asn.c: GetLength_ex - Fix type of bytes so that it can go negative.

sp_int.h: sp_clamp - add one to ii while it is a signed. Fix formatting.

Testing

Standard testing.

Checklist