Skip to content

Commit e05d173

Browse files
authored
Merge pull request #24 from deemru/1.x
1.0.4
2 parents 52d77be + 7e49bcc commit e05d173

File tree

4 files changed

+420
-83
lines changed

4 files changed

+420
-83
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.0.4
4+
5+
- Added DTLS-SRTP support: [`msspi_set_srtp_profiles()`](MSSPI.md#msspi_set_srtp_profiles), [`msspi_get_srtp_profile()`](MSSPI.md#msspi_get_srtp_profile)
6+
- Added keying material export: [`msspi_set_keying_material_info()`](MSSPI.md#msspi_set_keying_material_info), [`msspi_get_keying_material()`](MSSPI.md#msspi_get_keying_material)
7+
- Improved handshake loop in [`msspi_connect()`](MSSPI.md#msspi_connect) and [`msspi_accept()`](MSSPI.md#msspi_accept)
8+
9+
---
10+
311
## 1.0.3
412

513
- Fixed broken logic regression in [`msspi_get_peerchain()`](MSSPI.md#msspi_get_peerchain)

MSSPI.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The order of functions in the header file is **intentional and important**. Func
8787
2. **Basic configuration** - [`msspi_set_client()`](#msspi_set_client), [`msspi_set_dtls()`](#msspi_set_dtls) set operation mode
8888
3. **DTLS-specific** - [`msspi_set_dtls_peeraddr()`](#msspi_set_dtls_peeraddr), [`msspi_set_dtls_mtu()`](#msspi_set_dtls_mtu) if using DTLS
8989
4. **Credential-affecting parameters** - [`msspi_set_version()`](#msspi_set_version), [`msspi_set_cipherlist()`](#msspi_set_cipherlist), [`msspi_set_hostname()`](#msspi_set_hostname), [`msspi_set_peerauth()`](#msspi_set_peerauth), [`msspi_set_cachestring()`](#msspi_set_cachestring) **must be called before certificate functions** as they affect credential caching
90-
5. **Supporting configuration** - [`msspi_set_alpn()`](#msspi_set_alpn), [`msspi_set_certstore()`](#msspi_set_certstore), [`msspi_set_credprovider()`](#msspi_set_credprovider), [`msspi_set_pin_cache()`](#msspi_set_pin_cache), [`msspi_set_cert_cb()`](#msspi_set_cert_cb)
90+
5. **Supporting configuration** - [`msspi_set_alpn()`](#msspi_set_alpn), [`msspi_set_srtp_profiles()`](#msspi_set_srtp_profiles), [`msspi_set_certstore()`](#msspi_set_certstore), [`msspi_set_credprovider()`](#msspi_set_credprovider), [`msspi_set_pin_cache()`](#msspi_set_pin_cache), [`msspi_set_cert_cb()`](#msspi_set_cert_cb)
9191
6. **Certificate loading** - [`msspi_set_mycert()`](#msspi_set_mycert), [`msspi_add_mycert()`](#msspi_add_mycert), [`msspi_set_mycert_pfx()`](#msspi_set_mycert_pfx), [`msspi_add_mycert_pfx()`](#msspi_add_mycert_pfx), [`msspi_set_mycert_options()`](#msspi_set_mycert_options) **call LAST** to avoid cache mismatches
9292
9393
**Connection Phase:**
@@ -349,6 +349,23 @@ Sets ALPN (Application-Layer Protocol Negotiation) protocols.
349349
350350
---
351351
352+
### msspi_set_srtp_profiles
353+
354+
```c
355+
int msspi_set_srtp_profiles(MSSPI_HANDLE h, const uint8_t *profiles, size_t profiles_len);
356+
```
357+
358+
Sets SRTP (Secure Real-time Transport Protocol) protection profiles for DTLS-SRTP negotiation.
359+
360+
**Parameters:**
361+
- `h`: Handle
362+
- `profiles`: SRTP profile list in RFC 5764 format (list of 2-byte profile IDs)
363+
- `profiles_len`: Length of profiles data
364+
365+
**Returns:** `1` on success, `0` on failure
366+
367+
---
368+
352369
### msspi_set_peerauth
353370

354371
```c
@@ -967,6 +984,22 @@ Gets the negotiated ALPN protocol.
967984

968985
---
969986

987+
### msspi_get_srtp_profile
988+
989+
```c
990+
int msspi_get_srtp_profile(MSSPI_HANDLE h, uint16_t *profile);
991+
```
992+
993+
Gets the negotiated SRTP protection profile after DTLS-SRTP handshake.
994+
995+
**Parameters:**
996+
- `h`: Handle
997+
- `profile`: Pointer to receive the negotiated SRTP profile ID
998+
999+
**Returns:** `1` on success, `0` on failure
1000+
1001+
---
1002+
9701003
### msspi_get_verify_status
9711004
9721005
```c
@@ -1023,6 +1056,43 @@ Checks if the peer certificate exists in a specific Windows certificate store.
10231056

10241057
---
10251058

1059+
### msspi_set_keying_material_info
1060+
1061+
```c
1062+
int msspi_set_keying_material_info(MSSPI_HANDLE h, const uint8_t *label, size_t label_len, const uint8_t *context, size_t context_len, size_t keying_material_len);
1063+
```
1064+
1065+
Sets keying material export parameters for RFC 5705 (TLS) / RFC 8446 (TLS 1.3) key material export. Must be called after handshake completion and before [`msspi_get_keying_material()`](#msspi_get_keying_material).
1066+
1067+
**Parameters:**
1068+
- `h`: Handle
1069+
- `label`: Export label (ASCII string as bytes)
1070+
- `label_len`: Length of label
1071+
- `context`: Optional context value (can be `NULL` if `context_len` is 0)
1072+
- `context_len`: Length of context (0 if no context)
1073+
- `keying_material_len`: Desired length of exported keying material
1074+
1075+
**Returns:** `1` on success, `0` on failure
1076+
1077+
---
1078+
1079+
### msspi_get_keying_material
1080+
1081+
```c
1082+
int msspi_get_keying_material(MSSPI_HANDLE h, const uint8_t **keying_material, size_t *keying_material_len);
1083+
```
1084+
1085+
Exports keying material using parameters set by [`msspi_set_keying_material_info()`](#msspi_set_keying_material_info). Used for deriving keys for external protocols (e.g., SRTP keys in WebRTC).
1086+
1087+
**Parameters:**
1088+
- `h`: Handle
1089+
- `keying_material`: Pointer to receive exported key material
1090+
- `keying_material_len`: Pointer to receive length of exported material
1091+
1092+
**Returns:** `1` on success, `0` on failure
1093+
1094+
---
1095+
10261096
### msspi_close
10271097

10281098
```c

0 commit comments

Comments
 (0)