Commit bec9151
committed
card-piv.c Fix creation of serial number from FASC-N
The PIV CHUID object contains a FASC-N and a GUID. If the FASC-N is
all zeros the GUID will be used to create a serial number.
The FASC-N is a required field. Card issuers of non-US-government cards
should add a FASC-N staring with ";9999" (in ISO 4bit + parity code).
i.e. starts with "0xD4 0xE7 0x39"
New Token2 tokens with PIV (and maybe others) have an all zero FASC-N
which means without this patch the serial number is all zeros.
This can lead to problems if more then one card is on the system.
Note that the Yubico-piv-tool will create a FASC-N starting with ";9999"
so does not have this problem and the serial number will be based on the
GUID which is settable.
The use of the CHUID goes back to 2005 when both Microsoft and OpenSC
would use it for serial number and containerIds.
Changes to be committed:
modified: src/libopensc/card-piv.c1 parent 22ac38c commit bec9151
1 file changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4284 | 4284 | | |
4285 | 4285 | | |
4286 | 4286 | | |
4287 | | - | |
| 4287 | + | |
| 4288 | + | |
4288 | 4289 | | |
4289 | 4290 | | |
4290 | 4291 | | |
| |||
4312 | 4313 | | |
4313 | 4314 | | |
4314 | 4315 | | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
4315 | 4323 | | |
4316 | 4324 | | |
4317 | | - | |
4318 | 4325 | | |
4319 | 4326 | | |
4320 | 4327 | | |
| |||
4324 | 4331 | | |
4325 | 4332 | | |
4326 | 4333 | | |
4327 | | - | |
| 4334 | + | |
4328 | 4335 | | |
| 4336 | + | |
4329 | 4337 | | |
4330 | 4338 | | |
4331 | 4339 | | |
| |||
4335 | 4343 | | |
4336 | 4344 | | |
4337 | 4345 | | |
4338 | | - | |
4339 | | - | |
| 4346 | + | |
4340 | 4347 | | |
4341 | 4348 | | |
4342 | 4349 | | |
4343 | 4350 | | |
4344 | 4351 | | |
4345 | 4352 | | |
4346 | 4353 | | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
4347 | 4360 | | |
4348 | 4361 | | |
4349 | 4362 | | |
| |||
0 commit comments