-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C_Sign fails with 0x00000007 after inserting pin #38
Comments
Anyone ? |
What about the length of the hash it tries to sign? |
Since |
Can anyone help me here ? |
You are the only person who has access to your token, isn't it? The |
@wolneykien will do, thank you 👌 |
Any news? |
Sorry, I've been kind of busy with work and some other personal projects. I'll see if I can get the time to work on this issue this or next week. |
Well, some cards have upper limit for size of data can be successfully signed, but according to available mechanism list (where it supports To be sure that is not the case, you can use your PKCS#11 module in opensc's $ pkcs11-tool --module <your-module.so> -O -l
$ dd if=/dev/urandom bs=51 count=1 | pkcs11-tool --module <your-module.so> --sign \
--pin <your-card-pin> --id <your-rsa-key-id> -m RSA-PKCS or second one (which is correct data for RSA PKCS#1 v1.5 signature with SHA-256): printf "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20%32s" '' | \
pkcs11-tool --module <your-module.so> --sign --pin <your-card-pin> \
--id <your-rsa-key-id> -m RSA-PKCS If it is the same error, then your card (or rather PKCS#11 library that returns support for So possibly it is bug in PKCS#11 implementation. Some libraries incorrectly assume the first call for Try my PR #40, which also increases size of first-time buffer for getting signature. |
Hello, I compiled and installed all the necessary packages and configured
/etc/pam_pkcs11/subject_mapping
with my smart card's subject data, that I got frompkcs11_inspect
.I also added and linked the required CA certificates in
/etc/pam_pkcs11/cacerts
.I added the following line to
/etc/pam.d/sudo
:But whenever I try to use sudo and type my pin, I get this (snip from the actual log):
Complete Log:
This file says that 0x00000007 is CKR_ARGUMENTS_BAD.
I believe the first time h->fl->C_Sign runs, it returns
CKR_BUFFER_TOO_SMALL
, and in the second loop withsignature_length
of 256, it fails.pkcs11-tool -M
returns this:Why am I getting
sign_value() failed: C_Sign() failed: 0x00000007
?The text was updated successfully, but these errors were encountered: