Commit 4305f30
Infer KEY_SIZE from EC_CURVE for implicit sizes
In KeyMint, the KEY_SIZE tag is often omitted by callers when an EC_CURVE is explicitly provided, as the curve implicitly defines the bit length.
Previously, the simulator defaulted keySize to 0 when the tag was absent. This resulted in "0" being reported in the teeEnforced authorization list and KeyMetadata, which is a trivial detection vector for simulators.
Changes:
- Implemented `deriveKeySizeFromCurve()` to map EcCurve constants to their respective bit-sizes.
- Used the derived size as a fallback when Tag.KEY_SIZE is missing.
- Added support for Curve 25519 (256-bit).1 parent 0958d17 commit 4305f30
1 file changed
Lines changed: 14 additions & 1 deletion
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
| |||
0 commit comments