.\" $OpenBSD: ipsec.4,v 1.5 1998/03/05 09:30:59 provos Exp $ .\" Copyright 1997 Niels Provos .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Niels Provos. .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" Manual page, using -mandoc macros .\" .Dd September 5, 1997 .Dt IPSEC 4 .Os .Sh NAME .Nm ipsec .Nd IP Security Protocol .Sh SYNOPSIS .Fd #include .Fd #include .Fd #include .Fd #include .Ft int .Fn socket AF_ENCAP SOCK_RAW AF_UNSPEC .Sh DESCRIPTION .Tn IPSec is a pair of protocols, .Nm ESP (for Encapsulting Security Payload) and .Nm AH (for Authentication Header), which provide security services for IP datagrams. Specifically, .Nm ESP provides confidentiality, connectionless integrity, anti-replay service and limited traffic flow confidentiality. It optionally provides data origin authentication. .Nm AH provides connectionless integrity, data origin authentication and anti-replay service. .Pp This is done by inserting the appropriate header .Nm ( ESP or .Nm AH ) between the IP header and the payload. The inserted header, along with the IP header destination address, provide enough information to find the relevant state in the kernel (security association) and handle the packet appropriately (decrypt, authenticate etc.) .Pp An SA (Security Association) is uniquely defined by the .Nm SPI (Security Parameter Index), which is a 32-bit integer, the remote IP address and the security protocol. .Pp The payload can be any of the usual IP protocols (TCP, UDP, ICMP etc.) or IP itself, for those situations where IP tunneling is required. .Pp This implementation makes use of a virtual interface .Nm enc0 , which can be used in packet filters to specify those packets that have been successfully processed by IPSec. .Pp Security Associations can be set up manually with the .Xr ipsecadm 1 utility or the .Xr photurisd 8 key management daemon. .Sh BUGS There's a lot more to be said on this subject. This is just a beginning. .Sh SEE ALSO .Xr ip 4 , .Xr intro 4 , .Xr inet 4 , .Xr tcp 4 , .Xr udp 4 , .Xr icmp 4 , .Xr ipsecadm 1 , .Xr rt 1 , .Xr rtdelete 1 , .Xr photurisd 8 . .Sh ACKNOWLEDGMENTS The authors of this code are John Ioannidis, Angelos D. Keromytis and Niels Provos. .Pp Eric Young's libdeslite was used in this implementation for the DES algorithm. .Pp Steve Reid's SHA-1 code was also used. .Sh HISTORY The IPsec protocol started in 1992, by John Ioannidis, Phil Karn and William Allen Simpson. In 1995, the former wrote an implementation for BSD/OS. Angelos D. Keromytis ported it to OpenBSD and NetBSD. The latest transforms and new features were implemented by Angelos D. Keromytis and Niels Provos.