Commit 8bfaafb
net: sockets: tls: support PSA-resident private keys
Add a TLS_CREDENTIAL_PRIVATE_KEY_PSA credential type so a private key
already resident in PSA can be referenced by its psa_key_id_t instead
of being supplied as exported key material.
When this credential type is used, the TLS socket builds an opaque
Mbed TLS PK context with mbedtls_pk_wrap_psa() rather than parsing raw
key bytes. As a result the private key never leaves PSA: handshake
signatures are performed through psa_sign_hash(). This enables flows
where the key is generated on-device (non-exportable, stored in ITS)
and used for TLS client authentication without ever exporting it.
The credential buffer holds a psa_key_id_t; the public certificate is
still registered as TLS_CREDENTIAL_PUBLIC_CERTIFICATE and paired with
the opaque key by sec tag, unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>1 parent ac744d4 commit 8bfaafb
2 files changed
Lines changed: 98 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
1565 | 1573 | | |
1566 | 1574 | | |
1567 | 1575 | | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1568 | 1609 | | |
1569 | 1610 | | |
1570 | 1611 | | |
| |||
1598 | 1639 | | |
1599 | 1640 | | |
1600 | 1641 | | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1601 | 1646 | | |
1602 | 1647 | | |
1603 | 1648 | | |
| |||
2079 | 2124 | | |
2080 | 2125 | | |
2081 | 2126 | | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
2082 | 2162 | | |
2083 | 2163 | | |
2084 | 2164 | | |
| |||
2134 | 2214 | | |
2135 | 2215 | | |
2136 | 2216 | | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2137 | 2224 | | |
2138 | 2225 | | |
2139 | 2226 | | |
| |||
0 commit comments