From 5308f470384b48cc77feac11dec6c8eb5eff8cb5 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Fri, 21 Jul 2017 14:16:52 +0100 Subject: [PATCH] Fix implementation-defined integer conversion "When an integer is demoted to a signed integer with smaller size, or an unsigned integer is converted to its corresponding signed integer, if the value cannot be represented the result is implementation-defined." --- include/polarssl/x509_crt.h | 2 +- library/x509_crt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/polarssl/x509_crt.h b/include/polarssl/x509_crt.h index d534ad819..cb4326262 100644 --- a/include/polarssl/x509_crt.h +++ b/include/polarssl/x509_crt.h @@ -256,7 +256,7 @@ int x509_crt_verify_info( char *buf, size_t size, const char *prefix, * POLARSSL_ERR_X509_CERT_VERIFY_FAILED if the chain was verified * but found to be invalid, in which case *flags will have one * or more BADCERT_XXX or POLARSSL_X509_BADCRL_XXX - * flags set, or another error (and flags set to 0xffffffff) + * flags set, or another error (and flags set to -1) * in case of a fatal error encountered during the * verification process. */ diff --git a/library/x509_crt.c b/library/x509_crt.c index 3652a8c53..1ca61e5b3 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2182,7 +2182,7 @@ exit: if( ret != 0 ) { - *flags = (uint32_t) -1; + *flags = -1; return( ret ); }