From f55e92efa5562c76d8e3347cbf3a633facbaaaca Mon Sep 17 00:00:00 2001 From: Jason Scatena Date: Thu, 24 Aug 2023 10:56:37 -0400 Subject: [PATCH] Auth payload fix --- src/ikev2.rs | 2 ++ src/ikev2_parser.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/ikev2.rs b/src/ikev2.rs index 400f4a1..910efc1 100644 --- a/src/ikev2.rs +++ b/src/ikev2.rs @@ -348,6 +348,8 @@ pub struct CertificateRequestPayload<'a> { #[derive(Debug, PartialEq)] pub struct AuthenticationPayload<'a> { pub auth_method: AuthenticationMethod, + pub reserved1: u8, + pub reserved2: u16, pub auth_data: &'a [u8], } diff --git a/src/ikev2_parser.rs b/src/ikev2_parser.rs index c1dd0a1..5583df5 100644 --- a/src/ikev2_parser.rs +++ b/src/ikev2_parser.rs @@ -217,9 +217,13 @@ pub fn parse_ikev2_payload_authentication( return Err(Err::Error(make_error(i, ErrorKind::Verify))); } let (i, auth_method) = map(be_u8, AuthenticationMethod)(i)?; + let (i, reserved1) = be_u8(i)?; + let (i, reserved2) = be_u16(i)?; let (i, auth_data) = take(length - 4)(i)?; let payload = AuthenticationPayload { auth_method, + reserved1, + reserved2, auth_data, }; Ok((i, IkeV2PayloadContent::Authentication(payload)))