Il mio kernel Linux supporta già l'accelerazione hardware CESA e openssl può usare questa funzionalità:
# openssl speed -evp des3 -elapsed
# cat /proc/interrupts | grep cesa
51: 464810 GIC cesa0
52: 464811 GIC cesa1
E ho abilitato il plugin openssl in strongswan, ed è caricato quando il tunnel è attivo:
# ipsec statusall
Security Associations (1 up, 0 connecting):
cisco-ezvpn[1]: ESTABLISHED 10 minutes ago, 192.168.1.2[19]...192.168.1.1[192.168.1.1]
cisco-ezvpn[1]: IKEv1 SPIs: abf425e9297ad9f0_i* 196cb5ae22f4f22e_r, pre-shared key+XAuth reauthentication in 23 hours
cisco-ezvpn[1]: IKE proposal: AES_CBC_128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024
cisco-ezvpn{1}: INSTALLED, TUNNEL, reqid 1, ESP SPIs: cb142c69_i 2e8c4f0b_o
cisco-ezvpn{1}: AES_CBC_128/HMAC_SHA1_96, 41756845 bytes_i (30575 pkts, 107s ago), 550565 bytes_o (9492 pkts, 31s ago), rekeying in 23 hours
cisco-ezvpn{1}: 10.10.0.6/32 === 0.0.0.0/0
Ora, posso vedere gli interrupt di cesa aumentare quando la connessione è attiva (messaggi IKE), ma i pacchetti ESP non incessano i contatori di cesa interrupts:
15:17:28.653001 IP 192.168.1.2 > 192.168.1.1: ESP(spi=0x852c54c5,seq=0x16), length 108
15:17:49.653014 IP 192.168.1.2 > 192.168.1.1: ESP(spi=0x852c54c5,seq=0x17), length 108
15:17:49.653833 IP 192.168.1.1 > 192.168.1.2: ESP(spi=0xcca314fc,seq=0x10), length 92
15:18:35.652995 IP 192.168.1.2 > 192.168.1.1: ESP(spi=0x852c54c5,seq=0x18), length 108
# cat /proc/interrupts | grep cesa
51: 464813 GIC cesa0
52: 464814 GIC cesa1
La mia domanda è: esiste un modo per abilitare l'accelerazione hardware sui pacchetti ESP?
Informazioni aggiuntive:
# ip xfrm state
src 192.168.1.2 dst 192.168.1.1
proto esp spi 0x2e8c4f0b reqid 1 mode tunnel
replay-window 0 flag af-unspec
auth-trunc hmac(sha1) 0x19a289b54670ad8a41ec2314bd6c7b438efef9f2 96
enc cbc(aes) 0xc3297e37547fce35df7e3cd2d8450db5
src 192.168.1.1 dst 192.168.1.2
proto esp spi 0xcb142c69 reqid 1 mode tunnel
replay-window 32 flag af-unspec
auth-trunc hmac(sha1) 0xbb3033e4825ccc585c7829fa21b6c0c08bcefce9 96
enc cbc(aes) 0xc45486fdbcafef85e393295d7baeb968
Cifrari supportati:
# cat /proc/crypto
name : authenc(hmac(md5),cbc(des3_ede))
driver : authenc(hmac(md5-generic),cbc(des3_ede-generic))
module : kernel
priority : 0
refcnt : 3
selftest : passed
type : aead
async : yes
blocksize : 8
ivsize : 8
maxauthsize : 16
geniv : <built-in>
name : cbc(des3_ede)
driver : cbc(des3_ede-generic)
module : kernel
priority : 0
refcnt : 3
selftest : passed
type : givcipher
async : yes
blocksize : 8
min keysize : 24
max keysize : 24
ivsize : 8
geniv : chainiv
name : cbc(des3_ede)
driver : cbc(des3_ede-generic)
module : kernel
priority : 0
refcnt : 3
selftest : passed
type : blkcipher
blocksize : 8
min keysize : 24
max keysize : 24
ivsize : 8
geniv : <default>
name : hmac(md5)
driver : hmac(md5-generic)
module : kernel
priority : 0
refcnt : 5
selftest : passed
type : shash
blocksize : 64
digestsize : 16
name : stdrng
driver : krng
module : kernel
priority : 200
refcnt : 2
selftest : passed
type : rng
seedsize : 0
name : lzo
driver : lzo-generic
module : kernel
priority : 0
refcnt : 2
selftest : passed
type : compression
name : crc32c
driver : crc32c-generic
module : kernel
priority : 100
refcnt : 2
selftest : passed
type : shash
blocksize : 1
digestsize : 4
name : deflate
driver : deflate-generic
module : kernel
priority : 0
refcnt : 2
selftest : passed
type : compression
name : aes
driver : aes-generic
module : kernel
priority : 100
refcnt : 2
selftest : passed
type : cipher
blocksize : 16
min keysize : 16
max keysize : 32
name : des3_ede
driver : des3_ede-generic
module : kernel
priority : 0
refcnt : 3
selftest : passed
type : cipher
blocksize : 8
min keysize : 24
max keysize : 24
name : des
driver : des-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : cipher
blocksize : 8
min keysize : 8
max keysize : 8
name : sha224
driver : sha224-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 28
name : sha256
driver : sha256-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 32
name : sha1
driver : sha1-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 20
name : md5
driver : md5-generic
module : kernel
priority : 0
refcnt : 3
selftest : passed
type : shash
blocksize : 64
digestsize : 16
marvell_cesa
il modulo è stato apparentemente aggiunto con Linux 4.2. Nei kernel più vecchi solo il mv_cesa
il modulo è disponibile, che sembra supportare solo AES e SHA-1. Quindi potresti voler aggiornare il tuo kernel o usare diversi algoritmi per le tue IPsec SA.
/proc/crypto
mostra che le implementazioni per gli algoritmi utilizzati dalle SA IPsec (vediip xfrm state
) sono forniti dalmarvell_cesa
modulo.