Skip to content

Commit ba3f7b7

Browse files
uefi-raw: Add TlsConfigurationProtocol
Co-authored-by: Ben Krieger <[email protected]>
1 parent 06b41c9 commit ba3f7b7

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

uefi-raw/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Added
44
- Added `Ipv4Address`, `Ipv6Address`, and `MacAddress` types.
55
- Added `ServiceBindingProtocol`, `Dhcp4Protocol`, `HttpProtocol`,
6-
`Ip4Config2Protocol`, and related types.
6+
`Ip4Config2Protocol`, `TlsConfigurationProtocol`, and related types.
77

88
# uefi-raw - 0.5.0 (2023-11-12)
99

uefi-raw/src/protocol/network/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ pub mod dhcp4;
22
pub mod http;
33
pub mod ip4;
44
pub mod ip4_config2;
5+
pub mod tls;

uefi-raw/src/protocol/network/tls.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use crate::{guid, Guid, Status};
2+
use core::ffi::c_void;
3+
4+
newtype_enum! {
5+
pub enum TlsConfigDataType: i32 => {
6+
HOST_PUBLIC_CERT = 0,
7+
HOST_PRIVATE_KEY = 1,
8+
CA_CERTIFICATE = 2,
9+
CERT_REVOCATION_LIST = 3,
10+
MAXIMUM = 4,
11+
}
12+
}
13+
14+
#[derive(Debug)]
15+
#[repr(C)]
16+
pub struct TlsConfigurationProtocol {
17+
pub set_data: unsafe extern "efiapi" fn(
18+
this: *mut Self,
19+
typ: TlsConfigDataType,
20+
data: *const c_void,
21+
size: usize,
22+
) -> Status,
23+
24+
pub get_data: unsafe extern "efiapi" fn(
25+
this: *const Self,
26+
typ: TlsConfigDataType,
27+
data: *mut c_void,
28+
size: *mut usize,
29+
) -> Status,
30+
}
31+
32+
impl TlsConfigurationProtocol {
33+
pub const GUID: Guid = guid!("1682fe44-bd7a-4407-b7c7-dca37ca3922d");
34+
pub const SERVICE_BINDING_GUID: Guid = guid!("952cb795-ff36-48cf-a249-4df486d6ab8d");
35+
}

0 commit comments

Comments
 (0)