$Id: report-ENskip.txt,v 1.1.1.1 1999/10/26 17:19:16 sakane Exp $ %Hd: ENskip のIPsecまわりの処理 注意: 1996年8月頃調査したものです。もったいないので公開。 - READMEより This is ENskip, pre-alpha 0.50. ENskip is a security module for the TCP/IP stack. It provides encryption and authentication of packets on the IP layer between two or more machines. For more information on the SKIP protocol, see the Internet Draft draft-ietf-ipsec-skip-05.txt and following. You might also want to check http://skip.incog.com for information about the background, the protocol itself and future directions of it. ENskip is pre-alpha. If you are not absolutely sure what this is all about, you might want to read the draft in the doc directory, and perhaps reconsider using this package. Refer to INSTALL for information about the installation process. Check BUGS for known problems. No bug-fixes, installation help or any other support is granted. If you have any suggestions, comments or contributions to make ENskip work better, mail to . For exchange of ideas and information regarding the implementation of SKIP in software you can subscribe to a mailing list by sending a mail to: "subscribe skip-info [your real name]" should be in the body of your message. Refer to DISCLAIMER about the warranties not taken by this pre-alpha version. Enjoy! M. Hauber and Ch. Schneider G. Caronni - 処理条件 送信時は、インターフェイスで判断する。 受信時は、ip->ip_p で判断する。 送信時は、既存のインターフェイスの(*if_output)を置き換えて処理を行う。 暗号化処理を行い、その後、オリジナルのインターフェイス処理を行う。 受信時は、ip->ip_p で判断する。 socket V A layer | | ----|-------------------------------------------------|----- | | tcp_output tcp_input | | | +----------- (ip->ip_p> protocol | | | layer ip_output interface_input ipintr | | | | | | | | | ----|--------------------------------|----------------|----- | | | (*if_output) ----------+ interface_doinput | interface | | | | layer |<--------- interface_output +--------------->| | | ethernet_output ethernet_input | | ----|-------------------------------------------------|----- | | V A - SKIP初期化 com_skipcall はシステムコール com_skipcall [proc, skipcallparam] netbsd/com.c req_handle [skipcallparam->req] をコール req_handle [*skipreq_hdr] lib/req.c SKIPREQ_ATTACH の時、interface_attach(NULL, hdr->srcip) をコール interface_attach [IPaddr] netbsd/interface.c IPaddr(?) に対する ifnet->if_output に interface_output を定義 interface構造体を作成 ifnet->if_output を interface->output に保存 ifnet を interface->ifp に保存 interface_init netbsd/interface.c pffindproto(AF_INET, IPPROTO_RAW, SOCK_RAW)に対する protosw->pr_input に interface_input を定義 oldinput に pr->pr_input を保存 - パケット送信 interface_output [ifp, m, dst, ro->ro_rt ] netbsd/interface.c ifp->if_output でコールされる。 skip_process(SKIP_OUTPUT, &fb, NULL, (void **)&newm, &oldmb, &newmb)コール interface->output(ifp, newm, address, rt) をコールする 元のインターフェイスに渡す - パケット受信 interface_input [mbuf, hlen] netbsd/interface.c protosw->pr_input でコールされる ip->ip_p == IPPROTO_SKIP に対するパケットについて、 interface_doinput [mbuf] をコール interface_doinput [mbuf] mbufの調整? skip_process(SKIP_INPUT, NULL, NULL, (void **)&newm, &oldmb, &newmb)コール IF_ENQUEUE(ifp, newm) - 暗号/復号化 skip_process [dir, *interface, *header, **pkt skip_lookup(&skipcache, dir, interface, header, pkt, old) skip_convert (skipcache, skip_enskip ipsp_ip2ipsp esp_encrypt crypt_encrypt