After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767122 - test-suite failure on 32bit architectures
test-suite failure on 32bit architectures
Status: RESOLVED OBSOLETE
Product: gnome-keyring
Classification: Core
Component: general
3.20.x
Other Linux
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-06-01 18:14 UTC by Michael Biebl
Modified: 2021-06-18 10:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Biebl 2016-06-01 18:14:31 UTC
Version: 3.20.0

As can be seen at 
https://buildd.debian.org/status/package.php?p=gnome-keyring
the test-suite fails on various architectures
The failing tests are

ERROR:pkcs11/gnome2-store/test-gnome2-private-key.c:147:test_save_private_key: assertion failed: (gkm_data_der_read_private_pkcs8_crypted (data, "booo", 4, &sexp) == GKM_DATA_SUCCESS)
FAIL: test-gnome2-private-key 2 /gnome2-store/private-key/save
ERROR: test-gnome2-private-key process failed: 250

ERROR:pkcs11/gkm/test-data-der.c:574:test_write_pkcs8_encrypted: assertion failed: (res == GKM_DATA_SUCCESS)
FAIL: test-data-der 16 /gkm/data-der/write_pkcs8_encrypted
ERROR: test-data-der process failed: 250


This points are a real issue on 32bit architectures.
Comment 1 Dmitry Shachnev 2016-06-21 20:36:54 UTC
I have reported this earlier in bug 754633.

Today I did some investigation of this, and found that there is an integer overflow in atlv_parse_length() function.

There is the following fragment of code in that function:

 while (punt <= k && punt < n_data) {
     last = ans;
     ans = ans * 256;
     ...
 }

By multiplying by 256, we quickly reach the max size of int on 32-bit systems. Here is my log for values of ans:

 ans = 0
 ans = 0 + 254 = 254
 ans = 254 * 256 = 65024
 ans = 65024 + 187 = 65211
 ans = 65211 * 256 = 16694016
 ans = 16694016 + 7 = 16694023
 ans = 16694023 * 256 = -21297408  // oops!
 ans < last, returning -2

I know nothing about what this function is for and in what range should the return values be, so I will leave it to Stef to decide what to do here.
Comment 2 Michael Biebl 2016-08-07 16:43:49 UTC
Stef, would be great to have your input on this.
Comment 3 Stef Walter 2016-08-19 08:47:30 UTC
I looked at this a bit (ran out of time) and came to the conclusion that this was related to a bad encoding rather than lousy decoding. More soon, hopefully.
Comment 4 Michael Biebl 2016-09-02 21:15:33 UTC
Hi Stef, do you have any updates?
Comment 5 André Klapper 2021-06-18 10:39:37 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/

Thank you for your understanding and your help.