[openssl-dev] [openssl.org #3862] Patch: Compiler messages on OpenVMS

Dr. Martin P.J. Zinser via RT rt at openssl.org
Mon May 25 20:02:21 UTC 2015


Hello,

I've just build OpenSSL 1.0.2a on

OpenVMS 8.3 (Alpha)
HP C V 7.3

The build (and test) went very smooth, with just three minor complaints by the 
compiler:

 Compiling The BIO Library Files. (LIBRARY,LIB)
        bio_lib.c
        bio_cb.c
        ...
        bss_dgram.c

        if (timeleft.tv_sec < 0) {
............^
%CC-I-QUESTCOMPARE, In this statement, the unsigned expression 
"timeleft.tv_sec" is being compared with a relational operator to a constant 
whose v
alue is not greater than zero.  This might not be what you intended.
at line number 313 in file PUBLIC$ROOT:
[UTIL.LIBS.OPENSSL102.CRYPTO.BIO]BSS_DGRAM.C;1

...
Building The SYS$DISK:[-.ALPHA.EXE.SSL]SSL_LIBSSL32.OLB Library.
        s2_meth.c
        s2_srvr.c
        ...
        t1_lib.c

            if (size <= 0 || ((len = data[0])) != (size - 1)) {
................^
%CC-I-QUESTCOMPARE, In this statement, the unsigned expression "size" 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 2085 in file PUBLIC$ROOT:[UTIL.LIBS.OPENSSL102.SSL]T1_LIB.C;1

...
Compiling The ccgost Library Files. (ENGINES)
        e_gost_err
        gost2001_keyx
        gost2001
        gost89
        gost94_keyx

    if (*outlen <= 0) {
........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned expression "*outlen" 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 178 in file PUBLIC$ROOT:
[UTIL.LIBS.OPENSSL102.ENGINES.CCGOST]GOST94_KEYX.C;1


As can be easily seen, all three complaints are of the same type. They also 
can be easily cured by explicitly casting the the questionable parameters to 
(signed) int. 

The diff below shows the modifications. 

As a crosscheck I've applied them on Linux system

(openSUSE 13.2, Kernel 3.16.7, GCC 4.8.3, GLIBC 2.19), which compiled and 
passed all tests succesfully (same as before the patch).

I'd be obliged if you'd consider this change for inclusion in a future version 
of OpenSSL.

Greetings,

Martin


diff -c crypto/bio/bss_dgram.c crypto/bio/bss_dgram.c.orig
*** crypto/bio/bss_dgram.c      2015-05-25 17:00:19.000000000 +0200
--- crypto/bio/bss_dgram.c.orig 2015-05-25 18:19:45.203792595 +0200
***************
*** 310,316 ****
              timeleft.tv_usec += 1000000;
          }
  
!         if ((int)timeleft.tv_sec < 0) {
              timeleft.tv_sec = 0;
              timeleft.tv_usec = 1;
          }
--- 310,316 ----
              timeleft.tv_usec += 1000000;
          }
  
!         if (timeleft.tv_sec < 0) {
              timeleft.tv_sec = 0;
              timeleft.tv_usec = 1;
          }

diff -c ssl/t1_lib.c ssl/t1_lib.c.orig 
*** ssl/t1_lib.c        2015-05-25 17:29:57.000000000 +0200
--- ssl/t1_lib.c.orig   2015-05-25 18:43:23.249543083 +0200
***************
*** 2082,2088 ****
          }
  # ifndef OPENSSL_NO_SRP
          else if (type == TLSEXT_TYPE_srp) {
!             if ((int)size <= 0 || ((len = data[0])) != (size - 1)) {
                  *al = SSL_AD_DECODE_ERROR;
                  return 0;
              }
--- 2082,2088 ----
          }
  # ifndef OPENSSL_NO_SRP
          else if (type == TLSEXT_TYPE_srp) {
!             if (size <= 0 || ((len = data[0])) != (size - 1)) {
                  *al = SSL_AD_DECODE_ERROR;
                  return 0;
              }

diff -c engines/ccgost/gost94_keyx.c engines/ccgost/gost94_keyx.c.orig 
*** engines/ccgost/gost94_keyx.c        2015-05-25 17:30:59.000000000 +0200
--- engines/ccgost/gost94_keyx.c.orig   2015-05-25 18:45:02.725271382 +0200
***************
*** 175,181 ****
      ASN1_OBJECT_free(gkt->key_agreement_info->cipher);
      gkt->key_agreement_info->cipher = OBJ_nid2obj(param->nid);
      *outlen = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL);
!     if ((int)(*outlen) <= 0) {
          GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT,
                  GOST_R_ERROR_PACKING_KEY_TRANSPORT_INFO);
          goto err;
--- 175,181 ----
      ASN1_OBJECT_free(gkt->key_agreement_info->cipher);
      gkt->key_agreement_info->cipher = OBJ_nid2obj(param->nid);
      *outlen = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL);
!     if (*outlen <= 0) {
          GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT,
                  GOST_R_ERROR_PACKING_KEY_TRANSPORT_INFO);
          goto err;




More information about the openssl-dev mailing list