make test fails with OpenSSL 0.9.8i, works fine on same machine with 0.9.8h, guessing BN_GF2m_mod_arr() change botched?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

make test fails with OpenSSL 0.9.8i, works fine on same machine with 0.9.8h, guessing BN_GF2m_mod_arr() change botched?

Ted Mittelstaedt
Hi All,

  I have a Solaris 2.5.1 system with all current patches.

  I built OpenSSL 0.9.8i with the command:

./config shared -L/usr/local/lib

then

edited Makefile and add -R/usr/local/lib:/usr/local/ssl/lib to CFLAG line

then

make

The build completes without errors.

make test

I get the following error partway through:

.
.
.
test BN_GF2m_mod_sqr
test BN_GF2m_mod_inv
test BN_GF2m_mod_div
test BN_GF2m_mod_exp
test BN_GF2m_mod_sqrt
test BN_GF2m_mod_solve_quad
running bc
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
..................................
Failed!
bc: -D726C354EAF4B1B00A96E3C861DC288D7F6A690A3F172826EE21AD9833F0F81A75859\
*** Error code 255
make: Fatal error: Command failed for target `test_bn'
Current working directory /home/openssl-0.9.8i/test
*** Error code 1
make: Fatal error: Command failed for target `tests'
# Broken Pipe

Building and testing OpenSSL 0.9.8h on the same machine works fine.

This is gcc 2.95.3

I noticed in the CHANGES between 0.9.8h and 0.9.8i:

  *) Fix BN_GF2m_mod_arr() top-bit cleanup code.
     [Huang Ying]

Here is the change that was made:

# diff -c /home/openssl-0.9.8h/crypto/bn/bn_gf2m.c
/home/openssl-0.9.8i/crypto/bn/bn_gf2m.c
*** /home/openssl-0.9.8h/crypto/bn/bn_gf2m.c    Wed Feb  8 11:16:11 2006
--- /home/openssl-0.9.8i/crypto/bn/bn_gf2m.c    Mon Jun 23 13:46:28 2008
***************
*** 384,390 ****
                if (zz == 0) break;
                d1 = BN_BITS2 - d0;

!               if (d0) z[dN] = (z[dN] << d1) >> d1; /* clear up the top d1
bits */
                z[0] ^= zz; /* reduction t^0 component */

                for (k = 1; p[k] != 0; k++)
--- 384,394 ----
                if (zz == 0) break;
                d1 = BN_BITS2 - d0;

!               /* clear up the top d1 bits */
!               if (d0)
!                       z[dN] = (z[dN] << d1) >> d1;
!               else
!                       z[dN] = 0;
                z[0] ^= zz; /* reduction t^0 component */

                for (k = 1; p[k] != 0; k++)
#

Is this correct for big endian platforms?

Please no comments from the peanut gallery about how old the platform
is and how everyone should be running lynucks on a peecee...

Ted

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: make test fails with OpenSSL 0.9.8i, works fine on same machine with 0.9.8h, guessing BN_GF2m_mod_arr() change botched?

Andy Polyakov
>   I have a Solaris 2.5.1 system with all current patches.
>
>   I built OpenSSL 0.9.8i with the command:
>
> ./config shared -L/usr/local/lib
>
> make test
>
> I get the following error partway through:
>
> .
> .
> .
> test BN_GF2m_mod_sqr
> test BN_GF2m_mod_inv
> test BN_GF2m_mod_div
> test BN_GF2m_mod_exp
> test BN_GF2m_mod_sqrt
> test BN_GF2m_mod_solve_quad
> running bc
> ............................................................................
> ...
> ..................................
> Failed!
> bc: -D726C354EAF4B1B00A96E3C861DC288D7F6A690A3F172826EE21AD9833F0F81A75859\
> *** Error code 255
> make: Fatal error: Command failed for target `test_bn'
> Current working directory /home/openssl-0.9.8i/test
> *** Error code 1
> make: Fatal error: Command failed for target `tests'
> # Broken Pipe

I don't think failure has anything to do with GF2m routines (because
their output is not exercised through bc). In test directory there
should be tmp.bntest file left. Pass it to GNU bc and pipe output to
grep -v ^0\$. Does it print above line? If you don't have GNU bc, submit
tmp.bntest. To spare public bandwidth feel free to send it to me.

As for correctness on big-endian. Yes, it's correct. A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: make test fails with OpenSSL 0.9.8i, works fine on same machine with 0.9.8h, guessing BN_GF2m_mod_arr() change botched?

Andy Polyakov
In reply to this post by Ted Mittelstaedt
>   I have a Solaris 2.5.1 system with all current patches.
>
>   I built OpenSSL 0.9.8i with the command:
>
> ./config shared -L/usr/local/lib
>
> make test
>
> I get the following error partway through:
>
> .
> .
> .
> test BN_GF2m_mod_sqr
> test BN_GF2m_mod_inv
> test BN_GF2m_mod_div
> test BN_GF2m_mod_exp
> test BN_GF2m_mod_sqrt
> test BN_GF2m_mod_solve_quad
> running bc
> ............................................................................
> ...
> ..................................
> Failed!
> bc: -D726C354EAF4B1B00A96E3C861DC288D7F6A690A3F172826EE21AD9833F0F81A75859\
> *** Error code 255
> make: Fatal error: Command failed for target `test_bn'
> Current working directory /home/openssl-0.9.8i/test
> *** Error code 1
> make: Fatal error: Command failed for target `tests'
> # Broken Pipe

As it turns out tmp.bntest passed to GNU bc does not report any errors
in bntest output. So it must be bug in Solaris bc. Solaris bc does have
the record of being buggy, and for this reason 'make test_bn' failure is
not considered as such, unless it's confirmed against non-Solaris bc. A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]