Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2389?usp=email
to review the following change.
Change subject: Add cast to BN_num_bytes return value for AWS-LC
......................................................................
Add cast to BN_num_bytes return value for AWS-LC
The return value of BN_num_bytes is int in OpenSSL but unsigned int in
AWS-LC. This caused a compiler warning, and causes builds with
-Werror=sign-conversion to fail. This commit casts the return value to
unsigned int.
Change-Id: I24d3e80182e4121b3d84c3bdc07d3172f872da8f
Signed-off-by: Max Fillinger <[email protected]>
---
M src/openvpn/ssl_verify_openssl.c
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/89/2389/1
diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c
index ee29691..ab3c872 100644
--- a/src/openvpn/ssl_verify_openssl.c
+++ b/src/openvpn/ssl_verify_openssl.c
@@ -61,7 +61,11 @@
BIGNUM *bn_serial = ASN1_INTEGER_to_BN(asn1_i, NULL);
if (bn_serial != NULL)
{
- int size = BN_num_bytes(bn_serial);
+ /* Cast the return value of BN_num_bytes to unsigned int because it is
+ * int in OpenSSL and unsigend int in AWS-LC. The return value of
+ * BN_num_bytes should never be negative, and if it is, the cast will
+ * turn it into an unacceptably large value which will fail this
check. */
+ unsigned int size = (unsigned int)BN_num_bytes(bn_serial);
size_ok = size <= MAX_SERIAL_SIZE;
}
BN_free(bn_serial);
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2389?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I24d3e80182e4121b3d84c3bdc07d3172f872da8f
Gerrit-Change-Number: 2389
Gerrit-PatchSet: 1
Gerrit-Owner: Max Fillinger <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel