p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
149 stars 91 forks source link

import-object: Avoid integer truncation on 32-bit platforms #609

Closed ueno closed 8 months ago

ueno commented 9 months ago

The build fails when compiling for 32-bit platforms with -Werror=incompatible-pointer-types:

  CFLAGS="-m32 -march=i686 -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion" setarch i686 -- meson setup _build
  setarch i686 -- meson compile -C _build -v
  ...

  ../p11-kit/import-object.c: In function ‘add_attrs_pubkey_rsa’:
  ../p11-kit/import-object.c:223:62: error: passing argument 3 of ‘p11_asn1_read’ from incompatible pointer type [-Werror=incompatible-pointer-types]
    223 |         attr_modulus.pValue = p11_asn1_read (asn, "modulus", &attr_modulus.ulValueLen);
        |                                                              ^~~~~~~~~~~~~~~~~~~~~~~~
        |                                                              |
        |                                                              long unsigned int *

Fixes: #608

coveralls commented 9 months ago

Coverage Status

coverage: 69.447% (+0.003%) from 69.444% when pulling d938f4a8a3a2f371e0a3bc1404a384b4b1f61020 on ueno:wip/dueno/int-size into 58cd1c05e001a4fe250c15f3599e79974bc509e3 on p11-glue:master.