RFC 9235: TCP Authentication Option (TCP-AO) Test Vectors
- J. Touch,
- J. Kuusisaari
Abstract
This document provides test vectors to validate implementations of
the two mandatory authentication algorithms specified for the TCP
Authentication Option over both IPv4 and IPv6. This includes
validation of the key derivation function (KDF) based on a set of
test connection parameters as well as validation of the message
authentication code (MAC). Vectors are provided for both currently
required pairs of KDF and MAC algorithms: KDF_HMAC_SHA1 and HMAC-
SHA-1-96, and KDF
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are candidates for any level of Internet Standard; see Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
This document provides test vectors to validate the correct implementation of the TCP Authentication Option (TCP-AO) [RFC5925] and its mandatory cryptographic algorithms defined in [RFC5926]. It includes the specification of all endpoint parameters to generate the variety of TCP segments covered by different keys and MAC coverage, i.e., both the default case and the variant where TCP options are ignored for middlebox traversal. It also includes both default key derivation functions (KDFs) and MAC generation algorithms [RFC5926] and lists common pitfalls of implementing the algorithms correctly.¶
The experimental extension to support NAT traversal [RFC6978] is not included in the provided test vectors.¶
This document provides test vectors from multiple implementations
that have been validated against each other for interoperabilit
2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Input Test Vectors
3.1. TCP Connection Parameters
The following parameters are used throughout this suite of test vectors. The terms 'active' and 'passive' are used as defined for TCP [RFC0793].¶
3.1.1. TCP-AO Parameters
The following values are used for all exchanges. This suite does not test key switchover. The KeyIDs are as indicated for TCP-AO [RFC5925]. The Master_Key is used to derive the traffic keys [RFC5926].¶
3.1.2. Active (Client) Side Parameters
The following endpoint parameters are used on the active side of the TCP connection, i.e., the side that initiates the TCP SYN.¶
3.1.3. Passive (Server) Side Parameters
The following endpoint parameters are used for the passive side of the TCP connection, i.e., the side that responds with a TCP SYN-ACK.¶
3.1.4. Other IP Fields and Options
No IP options are used in these test vectors.¶
All IPv4 packets use the following other parameters [RFC0791]: Differentiated Services Code Point (DSCP) = 111000 binary (CS7) as is typical for BGP, Explicit Congestion Notification (ECN) = 00 binary, set the Don't Fragment (DF) bit, and clear the More Fragments (MF) bit.¶
IPv4 uses a TTL of 255 decimal; IPv6 uses a hop limit of 255 decimal.¶
All IPv6 packets use the following other parameters [RFC8200]: traffic class = 0xe0 hexadecimal (DSCP = 111000 binary CS7, as is typical for BGP, with ECN = 00 binary) and no Extension Headers (EHs).¶
3.1.5. Other TCP Fields and Options
The SYN and SYN-ACK segments include Maximum Segment Size (MSS) [RFC0793], No Operation (NOP), Window Scale [RFC7323], Selective Acknowledgment (SACK) permitted [RFC2018], Timestamp [RFC7323], and TCP-AO [RFC5925], in that order.¶
All other example segments include NOP, NOP, Timestamp, and TCP-AO, in that order.¶
All segment urgent (URG) pointers are zero [RFC0793]. All segments with data set the push (PSH) flag [RFC0793].¶
Each TCP connection below uses the Initial Sequence Numbers (ISNs) as indicated at the front of each corresponding section.¶
4. IPv4 SHA-1 Output Test Vectors
The SHA-1 KDF and MAC algorithms, KDF_HMAC_SHA1 and HMAC-SHA-1-96, are computed as specified for TCP-AO [RFC5926].¶
In the following sections, all values are indicated as 2-digit hexadecimal values with spacing per line representing the contents of 16 consecutive bytes, as is typical for data dumps. The IP/TCP data indicates the entire IP packet, including the TCP segment and its options (whether covered by TCP-AO or not, as indicated), including TCP-AO.¶
5. IPv4 AES-128 Output Test Vectors
The AES-128 KDF and MAC algorithms, KDF
In the following sections, all values are indicated as 2-digit hexadecimal values with spacing per line representing the contents of 16 consecutive bytes, as is typical for data dumps. The IP/TCP data indicates the entire IP packet, including the TCP segment and its options (whether covered by TCP-AO or not, as indicated), including TCP-AO.¶
6. IPv6 SHA-1 Output Test Vectors
The SHA-1 KDF and MAC algorithms, KDF_HMAC_SHA1 and HMAC-SHA-1-96, are computed as specified for TCP-AO [RFC5926].¶
7. IPv6 AES-128 Output Test Vectors
The AES-128 KDF and MAC algorithms, KDF
8. Observed Implementation Errors
The following is a partial list of implementation errors that this set of test vectors is intended to validate.¶
8.3. String Handling Issues
The strings indicated in TCP-AO and its algorithms are indicated as
a sequence of bytes of known length. In some implementations
8.4. Header Coverage Issues
There is a separate parameter in the Master Key Tuple (MKT)
[RFC5925] to ignore options; this document provides test vectors for
both options
9. Security Considerations
This document is intended to assist in the validation of implementations of TCP-AO to further enable its more widespread use as a security mechanism to authenticate not only TCP payload contents but the TCP headers and protocol.¶
The Master_Key of "testvector" used here for test vector generation SHOULD NOT be used operationally.¶
10. IANA Considerations
This document has no IANA actions.¶
11. References
11.1. Normative References
- [RFC0791]
-
Postel, J., "Internet Protocol", STD 5, RFC 791, DOI 10
.17487 , , <https:///RFC0791 www >..rfc -editor .org /info /rfc791 - [RFC0793]
-
Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10
.17487 , , <https:///RFC0793 www >..rfc -editor .org /info /rfc793 - [RFC2018]
-
Mathis, M., Mahdavi, J., Floyd, S., and A. Romanow, "TCP Selective Acknowledgment Options", RFC 2018, DOI 10
.17487 , , <https:///RFC2018 www >..rfc -editor .org /info /rfc2018 - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC5925]
-
Touch, J., Mankin, A., and R. Bonica, "The TCP Authentication Option", RFC 5925, DOI 10
.17487 , , <https:///RFC5925 www >..rfc -editor .org /info /rfc5925 - [RFC5926]
-
Lebovitz, G. and E. Rescorla, "Cryptographic Algorithms for the TCP Authentication Option (TCP-AO)", RFC 5926, DOI 10
.17487 , , <https:///RFC5926 www >..rfc -editor .org /info /rfc5926 - [RFC6978]
-
Touch, J., "A TCP Authentication Option Extension for NAT Traversal", RFC 6978, DOI 10
.17487 , , <https:///RFC6978 www >..rfc -editor .org /info /rfc6978 - [RFC7323]
-
Borman, D., Braden, B., Jacobson, V., and R. Scheffenegger, Ed., "TCP Extensions for High Performance", RFC 7323, DOI 10
.17487 , , <https:///RFC7323 www >..rfc -editor .org /info /rfc7323 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8200]
-
Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", STD 86, RFC 8200, DOI 10
.17487 , , <https:///RFC8200 www >..rfc -editor .org /info /rfc8200
11.2. Informative References
- [RFC2202]
-
Cheng, P. and R. Glenn, "Test Cases for HMAC-MD5 and HMAC-SHA-1", RFC 2202, DOI 10
.17487 , , <https:///RFC2202 www >..rfc -editor .org /info /rfc2202 - [RFC4493]
-
Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The AES-CMAC Algorithm", RFC 4493, DOI 10
.17487 , , <https:///RFC4493 www >..rfc -editor .org /info /rfc4493 - [RFC9187]
-
Touch, J., "Sequence Number Extension for Windowed Protocols", RFC 9187, DOI 10
.17487 , , <https:///RFC9187 www >..rfc -editor .org /info /rfc9187
Acknowledgments
This work benefited from feedback from Russ Housley and Michael Scharf as well as discussions on the IETF TCPM email list and with the IESG.¶
This document was initially prepared using 2