python-pkcs11 icon indicating copy to clipboard operation
python-pkcs11 copied to clipboard

Python int too large to convert to C ssize_t

Open wjmelements opened this issue 6 years ago • 8 comments

ESC[36msigning_web |ESC[0m     for public_obj in session.get_objects(PUBLIC_KEY_OBJECTS_FILTER):
ESC[36msigning_web |ESC[0m   File "pkcs11/_pkcs11.pyx", line 282, in pkcs11._pkcs11.SearchIter.__next__
ESC[36msigning_web |ESC[0m   File "pkcs11/_pkcs11.pyx", line 599, in pkcs11._pkcs11.Object._make
ESC[36msigning_web |ESC[0m   File "pkcs11/_pkcs11.pyx", line 629, in pkcs11._pkcs11.Object.__getitem__
ESC[36msigning_web |ESC[0m   File "pkcs11/_utils.pyx", line 11, in pkcs11._pkcs11.CK_BYTE_buffer
ESC[36msigning_web |ESC[0m   File "stringsource", line 151, in View.MemoryView.array.__cinit__
ESC[36msigning_web |ESC[0m OverflowError: Python int too large to convert to C ssize_t

Version: ref 1bab4197f1098b6933dda2a12c5100f6d92cd706

wjmelements avatar Jun 20 '19 04:06 wjmelements

Tell me more about your setup. Is this building the released version or master?

danni avatar Jun 21 '19 00:06 danni

From our Pipfile

python-pkcs11 = { git = 'https://github.com/danni/python-pkcs11.git', ref = '1bab4197f1098b6933dda2a12c5100f6d92cd706' }

wjmelements avatar Jun 21 '19 21:06 wjmelements

And what platform/architecture?

danni avatar Jun 23 '19 23:06 danni

Docker image: python:3.7.3-stretch

https://github.com/docker-library/python/blob/34c9df35e9a69e9f0edde88e861b543edb8bc07a/3.7/stretch/Dockerfile

wjmelements avatar Jun 25 '19 01:06 wjmelements

The pkcs11 library is CloudHSM

wjmelements avatar Jun 25 '19 01:06 wjmelements

I think I've messed up a signed/vs unsigned integer somewhere here. Does it work without the filter?

danni avatar Jun 28 '19 09:06 danni

I have not seen the issue without the filter.

wjmelements avatar Jul 26 '19 19:07 wjmelements

I also get this, and I get with or without a filter.

cormallen avatar Mar 04 '24 13:03 cormallen