Page MenuHomeFreeBSD

Fix AES-CTR compatibility issue in ipsec
ClosedPublic

Authored by kd on May 25 2020, 11:00 AM.
Tags
None
Referenced Files
F174562649: D24999.id72282.diff
Sun, Oct 4, 4:47 AM
Unknown Object (File)
Fri, Sep 25, 3:22 PM
Unknown Object (File)
Wed, Sep 23, 2:02 PM
Unknown Object (File)
Mon, Sep 21, 2:59 PM
Unknown Object (File)
Fri, Sep 18, 10:36 AM
Unknown Object (File)
Thu, Sep 10, 5:34 AM
Unknown Object (File)
Tue, Sep 8, 3:15 PM
Unknown Object (File)
Tue, Sep 8, 6:23 AM
Subscribers

Details

Summary

r361390 decreased blocksize of AES-CTR from 16 to 1. Because of that ESP payload is no longer aligned to 16 bytes before being encrypted and sent.
This is a good change since RFC3686 specifies that the last block doesn't need to be aligned.
Because FreeBSD before r361390 couldn't decrypt partial blocks encrypted with AES-CTR we need to enforce 16 byte alignment in order to preserve compatibility.
Add a sysctl(on by default) to control it.

Test Plan

Create ipsec tunnel with FreeBSD host without r361390 and use AES-CTR encryption.
Ping it, turn the sysctl off, try to ping it again and verify that connectivity was lost.
Do a similar test connecting to a Linux host and FreeBSD with this patch applied.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable