From: James Jones Date: Mon, 21 Mar 2022 21:09:01 +0000 (-0500) Subject: Changed DHCPv4 Authentication (90) to struct and added test (#4425) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61b29aa4a72e6a32395c18fb5778d9cfc57d0791;p=thirdparty%2Ffreeradius-server.git Changed DHCPv4 Authentication (90) to struct and added test (#4425) Co-authored-by: Alan DeKok --- diff --git a/share/dictionary/dhcpv4/dictionary b/share/dictionary/dhcpv4/dictionary index 494370a5d4d..d6b112f454a 100644 --- a/share/dictionary/dhcpv4/dictionary +++ b/share/dictionary/dhcpv4/dictionary @@ -26,6 +26,7 @@ $INCLUDE dictionary.rfc2131 $INCLUDE dictionary.rfc2241 $INCLUDE dictionary.rfc2610 $INCLUDE dictionary.rfc3004 +$INCLUDE dictionary.rfc3118 $INCLUDE dictionary.rfc3397 $INCLUDE dictionary.rfc3442 $INCLUDE dictionary.rfc4280 diff --git a/share/dictionary/dhcpv4/dictionary.rfc2131 b/share/dictionary/dhcpv4/dictionary.rfc2131 index a3a7e0f89a4..94839a6cb8d 100644 --- a/share/dictionary/dhcpv4/dictionary.rfc2131 +++ b/share/dictionary/dhcpv4/dictionary.rfc2131 @@ -170,9 +170,6 @@ ATTRIBUTE Server-Identifier-Override 82.11 ipaddr # Internet Storage Name Service ATTRIBUTE iSNS 83 octets -# Authentication -ATTRIBUTE Authentication 90 octets - ATTRIBUTE Client-Last-Transaction-Time 91 uint32 # seconds on the past ATTRIBUTE associated-ip 92 ipaddr array diff --git a/share/dictionary/dhcpv4/dictionary.rfc3118 b/share/dictionary/dhcpv4/dictionary.rfc3118 new file mode 100644 index 00000000000..254dcce967a --- /dev/null +++ b/share/dictionary/dhcpv4/dictionary.rfc3118 @@ -0,0 +1,19 @@ +# -*- text -*- +# Copyright (C) 2022 The FreeRADIUS Server project and contributors +# This work is licensed under CC-BY version 4.0 https://creativecommons.org/licenses/by/4.0 +# Version $Id$ +############################################################################## +# +# RFC3118 - Authentication for DHCP Messages +# +# $Id$ +# +############################################################################## + +# Authentication +ATTRIBUTE Authentication 90 struct +MEMBER Protocol uint8 +MEMBER Algorithm uint8 +MEMBER RDM uint8 +MEMBER Replay-Detection uint64 +MEMBER Authentication-Information octets diff --git a/src/tests/unit/protocols/dhcpv4/rfc3118.txt b/src/tests/unit/protocols/dhcpv4/rfc3118.txt new file mode 100644 index 00000000000..a87ddd66d61 --- /dev/null +++ b/src/tests/unit/protocols/dhcpv4/rfc3118.txt @@ -0,0 +1,18 @@ +# +# Test vectors for DHCP attributes +# +proto dhcpv4 +proto-dictionary dhcpv4 +fuzzer-out dhcpv4 + +# +# Authentication +# +encode-pair Authentication = { Protocol = 1, Algorithm = 2, RDM = 32, Replay-Detection = 0, Authentication-Information = "123456789a123456789a123456789a" } +match 5a 29 01 02 20 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 + +decode-pair - +match Authentication = { Protocol = 1, Algorithm = 2, RDM = 32, Replay-Detection = 0, Authentication-Information = 0x313233343536373839613132333435363738396131323334353637383961 } + +count +match 7