Bugzilla – Attachment 3360 Details for
Bug 3130
[PATCH] Readable return codes for pkcs11 identities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to provide readable return codes for pkcs11 identities
0001-Provide-more-user-friendly-output-on-C_Login-errors.patch (text/plain), 1.27 KB, created by
Jacob Hoffman-Andrews
on 2020-03-06 04:46:20 AEDT
(
hide
)
Description:
Patch to provide readable return codes for pkcs11 identities
Filename:
MIME Type:
Creator:
Jacob Hoffman-Andrews
Created:
2020-03-06 04:46:20 AEDT
Size:
1.27 KB
patch
obsolete
>From 6e2f53a71e967b1e363c6f7d551ba9ac26314a72 Mon Sep 17 00:00:00 2001 >From: Jacob Hoffman-Andrews <github@hoffman-andrews.com> >Date: Wed, 26 Feb 2020 18:13:12 -0800 >Subject: [PATCH] Provide more user-friendly output on C_Login errors. > >This handles CKR_PIN_INCORRECT, CKR_PIN_LEN_RANGE, and CKR_PIN_LOCKED, >which are the errors a user is most likely to see. >--- > ssh-pkcs11.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c >index a302c79c..f5446c65 100644 >--- a/ssh-pkcs11.c >+++ b/ssh-pkcs11.c >@@ -271,8 +271,20 @@ pkcs11_login_slot(struct pkcs11_provider *provider, struct pkcs11_slotinfo *si, > (pin != NULL) ? strlen(pin) : 0); > if (pin != NULL) > freezero(pin, strlen(pin)); >+ if (rv == CKR_PIN_LEN_RANGE) { >+ error("Login to PKCS#11 token failed: PIN too long or too short"); >+ return (-1); >+ } >+ if (rv == CKR_PIN_INCORRECT) { >+ error("Login to PKCS#11 token failed: Incorrect PIN"); >+ return (-1); >+ } >+ if (rv == CKR_PIN_LOCKED) { >+ error("Login to PKCS#11 token failed: PIN locked"); >+ return (-1); >+ } > if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) { >- error("C_Login failed: %lu", rv); >+ error("Login to PKCS#11 token failed with return code %lu", rv); > return (-1); > } > si->logged_in = 1; >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3130
: 3360