Commit c9bb05e
committed
fix: fixes attribute reading on private objects
According to the PKCS#11 spec, all key objects have defined a semantic
for CKA_START_DATE and CKA_END_DATE, although, for key objects that are
private (e.g. CKO_PRIVATE_KEY, CKO_SECRET_KEY), the retrieval of their
values fail.
This is happening when an attribute with a specialized class, e.g.
P11AttrStartDate, gets added to a private object, its value is always
written in clear, due to the updateAttr method overload, although, upon
retrieving the value, due to the retrieve method not being symmetrically
overloaded, and because the object is private, the attribute value is
decrypted and fails.
This change adds protected virtual method `retrieveAttrByteString` to
allow overloading the default behavior, namely for public attributes
(written in clear), from private object.
Also add a base class `P11NonPrivateAttribute` to be extended by public
attributes specializations.1 parent 1a39ad7 commit c9bb05e
2 files changed
Lines changed: 52 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
73 | 90 | | |
74 | 91 | | |
| |||
273 | 290 | | |
274 | 291 | | |
275 | 292 | | |
276 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
277 | 296 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 297 | + | |
285 | 298 | | |
286 | | - | |
287 | | - | |
| 299 | + | |
288 | 300 | | |
289 | 301 | | |
290 | 302 | | |
| |||
332 | 344 | | |
333 | 345 | | |
334 | 346 | | |
335 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
336 | 350 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 351 | + | |
347 | 352 | | |
348 | | - | |
349 | | - | |
350 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
351 | 356 | | |
352 | 357 | | |
353 | 358 | | |
| |||
495 | 500 | | |
496 | 501 | | |
497 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
498 | 509 | | |
499 | 510 | | |
500 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| |||
455 | 468 | | |
456 | 469 | | |
457 | 470 | | |
458 | | - | |
| 471 | + | |
459 | 472 | | |
460 | 473 | | |
461 | 474 | | |
462 | | - | |
| 475 | + | |
463 | 476 | | |
464 | 477 | | |
465 | 478 | | |
| |||
473 | 486 | | |
474 | 487 | | |
475 | 488 | | |
476 | | - | |
| 489 | + | |
477 | 490 | | |
478 | 491 | | |
479 | 492 | | |
480 | | - | |
| 493 | + | |
481 | 494 | | |
482 | 495 | | |
483 | 496 | | |
| |||
0 commit comments