-
Notifications
You must be signed in to change notification settings - Fork 712
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
Unable to upload KEY into card #1465
Comments
Could you paste a permalink with the exact line? |
line 631 in src/libopensc/sc.c commit details here: 360e95d#diff-db0cd89ff279ad8c7b3bb780cdf2770a |
Yes, could you try if this change fixes it: diff --git a/src/libopensc/sc.c b/src/libopensc/sc.c
index 53fefb3e..ea634100 100644
--- a/src/libopensc/sc.c
+++ b/src/libopensc/sc.c
@@ -628,7 +628,7 @@ int sc_file_set_sec_attr(sc_file_t *file, const u8 *sec_attr,
return SC_ERROR_INVALID_ARGUMENTS;
}
- if (sec_attr == NULL || sec_attr_len) {
+ if (sec_attr == NULL || sec_attr_len == 0) {
if (file->sec_attr != NULL)
free(file->sec_attr);
file->sec_attr = NULL; |
OK, patch above checked, now key upload working as expected. |
mouse07410
added a commit
to mouse07410/OpenSC
that referenced
this issue
Aug 31, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem Description
Key upload failed with Security status not satisfied. (opensc 0.19.0-rc1, tested on MyEID card 3.3.3)
Steps to reproduce
pkcs15-init -E
pkcs15-init -C --so-pin 00000000 --so-puk 00000000 --pin 11111111
pkcs15-init --store-pin --id 01 --pin 11111111 --puk 11111111 --so-pin 00000000
pkcs15-init -F
pkcs15-init --store-private-key keys/rsa2048-key.pem --auth-id=1 --pin 11111111 --so-pin 00000000 -key-usage sign,decrypt --label test
Failed to store private key: Security status not satisfied
Proposed Resolution
commit 360e95d introduces lot of changes, but one change break correct reading of security attributes: (parent of this commit is 8fe377e)
Is this condition correct ? / if (sec_attr == NULL || sec_attr_len==0) /
The text was updated successfully, but these errors were encountered: