Segault while checking pkcs11 card signature
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pam-pkcs11 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Here are some traces:
```
P:1449015; T:0x140679159284416 13:52:27.127 [opensc-pkcs11] sec.c:59:
P:1449015; T:0x140679159284416 13:52:27.127 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card.c:473:sc_lock: called
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card.c:513:sc_lock: returning with: 0 (Success)
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card.c:473:sc_lock: called
P:1449015; T:0x140679159284416 13:52:27.128 [opensc-pkcs11] card.c:513:sc_lock: returning with: 0 (Success)
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] reader-
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] reader-
Outgoing APDU (44 bytes):
00 87 11 9A 26 7C 24 82 00 81 20 40 DD 29 19 4B ....&|$... @.).K
DE D5 92 6D ED 8B AC EA EC 76 79 7C 30 4F 74 2E ...m.....vy|0Ot.
AE 0A 95 38 D2 7F 90 95 77 1F BF 00 ...8....w...
P:1449015; T:0x140679159284416 13:52:27.129 [opensc-pkcs11] reader-
P:1449015; T:0x140679159284416 13:52:27.220 [opensc-pkcs11] reader-
Incoming APDU (77 bytes):
7C 49 82 47 30 45 02 20 16 31 BE 5A B7 0C 50 4D |I.G0E. .1.Z..PM
96 FD 21 01 C2 13 6B B9 12 91 D3 9E EA 2D B9 4D ..!...k......-.M
63 2D 38 1E 7A 8D A9 60 02 21 00 F8 D2 7E BF 9D c-8.z..`.!...~..
9D B5 1A D6 46 3C 51 00 BF 12 C2 3E 0D C1 4E 54 ....F<Q....>..NT
63 AD 41 5D 06 95 02 F2 59 6E EB 90 00 c.A]....Yn...
P:1449015; T:0x140679159284416 13:52:27.221 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.221 [opensc-pkcs11] apdu.c:
P:1449015; T:0x140679159284416 13:52:27.221 [opensc-pkcs11] card.c:
P:1449015; T:0x140679159284416 13:52:27.221 [opensc-pkcs11] card.c:
P:1449015; T:0x140679159284416 13:52:27.221 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.222 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.222 [opensc-pkcs11] card-piv.
P:1449015; T:0x140679159284416 13:52:27.222 [opensc-pkcs11] sec.c:63:
P:1449015; T:0x140679159284416 13:52:27.222 [opensc-pkcs11] card.c:
P:1449015; T:0x140679159284416 13:52:27.222 [opensc-pkcs11] pkcs15-
P:1449015; T:0x140679159284416 13:52:27.223 [opensc-pkcs11] pkcs15-
P:1449015; T:0x140679159284416 13:52:27.223 [opensc-pkcs11] card.c:
P:1449015; T:0x140679159284416 13:52:27.223 [opensc-pkcs11] reader-
P:1449015; T:0x140679159284416 13:52:27.224 [opensc-pkcs11] framework-
P:1449015; T:0x140679159284416 13:52:27.224 [opensc-pkcs11] mechanism.
P:1449015; T:0x140679159284416 13:52:27.224 [opensc-pkcs11] mechanism.
P:1449015; T:0x140679159284416 13:52:27.224 [opensc-pkcs11] pkcs11-
DEBUG:pkcs11_
DEBUG:pam_
DEBUG:cert_
DEBUG:cert_
Segmentation fault (core dumped)
```
To duplicate this issue:
```
$ cat /etc/pam.d/pkcs11
auth sufficient pam_pkcs11.so
```
and I used `pamtester`: `OPENSC_DEBUG=9 pamtester pkcs11 olivier authenticate`
After investigated this issue into the code, I actually found the issue and have a fix for it: https:/
My commit is sufficient to fix the issue.
I have just created a merge-request for Ubuntu package: https:/ /code.launchpad .net/~olivier- martin/ ubuntu/ +source/ pam-pkcs11/ +git/pam- pkcs11/ +merge/ 436857