Test script (from Dan):
#!/sbin/sh
echo "add ah spi 0x2112 authkey 0x1234567890abcdef1234567890abcdef authalg md5 dst localhost" | ipseckey
echo "add esp spi 0x5150 encrkey 0x1234567890abcdef1234567890abcdef encralg aes-cbc dst localhost" | ipseckey
ipseckey dump
ipseckey flush
echo "After this should be nothing..."
ipseckey dump
echo "...but this line"
output:
tsoome@test:~$ sudo -s
Password:
root@test:/home/tsoome# cd /tmp
root@test:/tmp# vi test.sh
root@test:/tmp# sh test.sh
Base message (version 2) type DUMP, SA type AH.
Message length 136 bytes, seq=1, pid=21829.
SA: SADB_ASSOC spi=0x2112, replay window size=0, state=MATURE
SA: Authentication algorithm = hmac-md5
SA: flags=0xc000 < X_OUTBOUND X_INBOUND >
SRC: Source address (proto=0/<unspecified>)
SRC: AF_INET: port 0, 0.0.0.0 <unspecified>.
DST: Destination address (proto=0/<unspecified>)
DST: AF_INET: port 0, 127.0.0.1 (test).
AKY: Authentication key.
AKY: 1234567890abcdef1234567890abcdef/128
LT: Lifetime information
CLT: Current lifetime information:
CLT: 0 bytes protected, 0 allocations used.
CLT: SA added at time: 11. märts 2019 18:22:22 EET
CLT: Time now is 11. märts 2019 18:22:22 EET
Base message (version 2) type DUMP, SA type AH.
Message length 168 bytes, seq=1, pid=21829.
SA: SADB_ASSOC spi=0x2112, replay window size=0, state=MATURE
SA: Authentication algorithm = hmac-md5
SA: flags=0xc000 < X_OUTBOUND X_INBOUND >
SRC: Source address (proto=0/<unspecified>)
SRC: AF_INET6: port 0, :: <unspecified>.
DST: Destination address (proto=0/<unspecified>)
DST: AF_INET6: port 0, ::1 (test).
AKY: Authentication key.
AKY: 1234567890abcdef1234567890abcdef/128
LT: Lifetime information
CLT: Current lifetime information:
CLT: 0 bytes protected, 0 allocations used.
CLT: SA added at time: 11. märts 2019 18:22:22 EET
CLT: Time now is 11. märts 2019 18:22:22 EET
Base message (version 2) type DUMP, SA type ESP.
Message length 152 bytes, seq=1, pid=21829.
SA: SADB_ASSOC spi=0x5150, replay window size=0, state=MATURE
SA: Encryption algorithm = aes-cbc
SA: flags=0xc000 < X_OUTBOUND X_INBOUND >
SRC: Source address (proto=0/<unspecified>)
SRC: AF_INET: port 0, 0.0.0.0 <unspecified>.
DST: Destination address (proto=0/<unspecified>)
DST: AF_INET: port 0, 127.0.0.1 (test).
EKY: Encryption key.
EKY: 1234567890abcdef1234567890abcdef/128
LT: Lifetime information
CLT: Current lifetime information:
CLT: 0 bytes protected, 0 allocations used.
CLT: SA added at time: 11. märts 2019 18:22:22 EET
CLT: Time now is 11. märts 2019 18:22:22 EET
Base message (version 2) type DUMP, SA type ESP.
Message length 184 bytes, seq=1, pid=21829.
SA: SADB_ASSOC spi=0x5150, replay window size=0, state=MATURE
SA: Encryption algorithm = aes-cbc
SA: flags=0xc000 < X_OUTBOUND X_INBOUND >
SRC: Source address (proto=0/<unspecified>)
SRC: AF_INET6: port 0, :: <unspecified>.
DST: Destination address (proto=0/<unspecified>)
DST: AF_INET6: port 0, ::1 (test).
EKY: Encryption key.
EKY: 1234567890abcdef1234567890abcdef/128
LT: Lifetime information
CLT: Current lifetime information:
CLT: 0 bytes protected, 0 allocations used.
CLT: SA added at time: 11. märts 2019 18:22:22 EET
CLT: Time now is 11. märts 2019 18:22:22 EET
Dump succeeded for SA type 0.
After this should be nothing...
Dump succeeded for SA type 0.
...but this line
root@test:/tmp#
The test was performed with following updates installed:
9b3a883f586 10484 ipsecah: cast between incompatible function types
c50588d91f7 10485 ipsecesp: cast between incompatible function types
f6867a93d04 10486 keysock: cast between incompatible function types