On Mon, Mar 21, 2011, Steven M. Schweda wrote:

>    Working on SNAP-20110321 on VMS, there seems to be a new, possibly
> significant compiler complaint in crypto/evp/evp_enc.c:
> 
>               if (i < 0)
> ....................^
> %CC-I-QUESTCOMPARE, In this statement, the unsigned expression "i" is
> being compared with a relational operator to a constant whose value is
> not greater than zero.  This might not be what you intended.
> at line number 372 in file
> IT$DKC0:[UTILITY.SOURCE.OPENSSL.openssl-SNAP-20110321.crypto.evp]evp_enc.c;1
> 
>    The relevant code looks like this:
> 
> [...]
> int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
>         {
>         int n,ret;
>         unsigned int i, b, bl;
> 
>         if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER)
>                 {
>                 i = ctx->cipher->do_cipher(ctx, out, NULL, 0);
>                 if (i < 0)
>                         return 0;
>                 else
>                         *outl = i;
>                 return 1;
>                 }
> [...]
> 
> 
> "do_cipher" seems to be an "int" (crypto/evp/evp.h), as does "*outl", so
> it looks to me as if "n" would be a better choice than "i" here.
> 
> --- crypto/evp/evp_enc.c_orig 2011-02-07 13:00:04 -0600
> +++ crypto/evp/evp_enc.c      2011-03-21 11:30:24 -0500
> @@ -368,11 +368,11 @@
>  
>       if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER)
>               {
> -             i = ctx->cipher->do_cipher(ctx, out, NULL, 0);
> -             if (i < 0)
> +             n = ctx->cipher->do_cipher(ctx, out, NULL, 0);
> +             if (n < 0)
>                       return 0;
>               else 
> -                     *outl = i;
> +                     *outl = n;
>               return 1;
>               }
> 
>    Several other problems, too, but this one looked easy.
>  

Thanks for the report, fixed now.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to