Bugzilla – Attachment 341 Details for
Bug 608
smartcard: ask for passphrase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to add: as for smartcard pin/password/passphrase
x.patch (text/plain), 1.25 KB, created by
Andreas Jellinghaus
on 2003-06-28 19:50:08 AEST
(
hide
)
Description:
patch to add: as for smartcard pin/password/passphrase
Filename:
MIME Type:
Creator:
Andreas Jellinghaus
Created:
2003-06-28 19:50:08 AEST
Size:
1.25 KB
patch
obsolete
>diff -u -3 -p -r1.9 scard-opensc.c >--- scard-opensc.c 5 Jun 2003 09:19:35 -0000 1.9 >+++ scard-opensc.c 16 Jun 2003 10:13:43 -0000 >@@ -143,11 +149,42 @@ sc_prkey_op_init(RSA *rsa, struct sc_pkc > *key_obj_out = key_obj; > return 0; > } else if (r) { >+ /* some other OpenSC internal error */ > error("Unable to find PIN object from SmartCard: %s", > sc_strerror(r)); > goto err; > } > pin = pin_obj->data; >+ >+ if ((pin->auth_id.len > 0) && (! sc_pin)) { >+ /* we need a pin, we don't have one. let's ask. */ >+ char *passphrase; >+ passphrase = read_passphrase("Enter passphrase for key:", 0); >+ if (! passphrase) >+ goto err; >+ if (strcmp(passphrase, "") == 0) >+ goto err; >+ r = sc_lock(card); >+ if (r) { >+ error("Unable to lock smartcard: %s", >+ sc_strerror(r)); >+ memset(passphrase, 0, strlen(passphrase)); >+ xfree(passphrase); >+ goto err; >+ } >+ r = sc_pkcs15_verify_pin(p15card, pin, >+ passphrase, strlen(passphrase)); >+ memset(passphrase, 0, strlen(passphrase)); >+ xfree(passphrase); >+ if (r) { >+ sc_unlock(card); >+ error("PIN code verification failed: %s", >+ sc_strerror(r)); >+ goto err; >+ } >+ *key_obj_out = key_obj; >+ return 0; >+ } > r = sc_lock(card); > if (r) { > error("Unable to lock smartcard: %s", sc_strerror(r));
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 608
:
341
|
374