| 1 |
Security review for libcanlock 3.0.0pre27 |
| 2 |
========================================= |
| 3 |
(2018-01-05 by Michael Baeuerle) |
| 4 |
|
| 5 |
This review should identify places where libcanlock will copy the secret from |
| 6 |
the caller to different memory locations. These places (marked "Lx" below) are |
| 7 |
candidates for calling "cl_clear_secret()" internally. |
| 8 |
|
| 9 |
Note: |
| 10 |
A patch to overwrite locations Lx after use is included in version 3.0.0rc1. |
| 11 |
|
| 12 |
Note2: |
| 13 |
Since version 3.2.2 the internal API hmac* was renamed to RFC2104Hmac*. |
| 14 |
|
| 15 |
|
| 16 |
canlock.c |
| 17 |
========= |
| 18 |
|
| 19 |
sha_lock() -> cl_get_lock() |
| 20 |
| |
| 21 |
sha_key() -----+-> cl_get_key() -> hmac() |
| 22 |
|
| 23 |
|
| 24 |
hmac.c |
| 25 |
====== |
| 26 |
|
| 27 |
hmac() -+-> hmacReset() -+-> USHAInput() -> tcontext ; Location L2 |
| 28 |
| | |
| 29 |
| +----------------> k_ipad[] ; Location L3 |
| 30 |
| |
| 31 |
+----------------------------------> context ; Location L1 |
| 32 |
|
| 33 |
|
| 34 |
usha.c |
| 35 |
====== |
| 36 |
|
| 37 |
USHAInput() -> SHA<xxx>Input() ; With "xxx" as listed below |
| 38 |
|
| 39 |
|
| 40 |
sha1.c |
| 41 |
====== |
| 42 |
|
| 43 |
SHA1Input() -> SHA1ProcessMessageBlock() -> W[] ; Location L4 |
| 44 |
|
| 45 |
|
| 46 |
sha224-256.c |
| 47 |
============ |
| 48 |
|
| 49 |
SHA224Input() -+ |
| 50 |
| |
| 51 |
SHA256Input() -+-> SHA224_256ProcessMessageBlock() -> W[] ; Location L5 |
| 52 |
|
| 53 |
|
| 54 |
sha384-512.c |
| 55 |
============ |
| 56 |
|
| 57 |
SHA384Input() -+ |
| 58 |
| |
| 59 |
SHA512Input() -+-> SHA384_512ProcessMessageBlock() -> W[] ; Location L6a/L6b |
| 60 |
|
| 61 |
|
| 62 |
EOF |