Changeset View
Changeset View
Standalone View
Standalone View
lib/libipsec/pfkey_dump.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
#include <string.h> | #include <string.h> | ||||
#include <time.h> | #include <time.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
#include "ipsec_strerror.h" | #include "ipsec_strerror.h" | ||||
#include "libpfkey.h" | #include "libpfkey.h" | ||||
/* cope with old kame headers - ugly */ | /* cope with old kame headers - ugly */ | ||||
#ifndef SADB_X_AALG_MD5 | |||||
#define SADB_X_AALG_MD5 SADB_AALG_MD5 | |||||
#endif | |||||
#ifndef SADB_X_AALG_SHA | |||||
#define SADB_X_AALG_SHA SADB_AALG_SHA | |||||
#endif | |||||
#ifndef SADB_X_AALG_NULL | #ifndef SADB_X_AALG_NULL | ||||
#define SADB_X_AALG_NULL SADB_AALG_NULL | #define SADB_X_AALG_NULL SADB_AALG_NULL | ||||
#endif | #endif | ||||
#ifndef SADB_X_EALG_BLOWFISHCBC | |||||
#define SADB_X_EALG_BLOWFISHCBC SADB_EALG_BLOWFISHCBC | |||||
#endif | |||||
#ifndef SADB_X_EALG_CAST128CBC | |||||
#define SADB_X_EALG_CAST128CBC SADB_EALG_CAST128CBC | |||||
#endif | |||||
#ifndef SADB_X_EALG_RC5CBC | #ifndef SADB_X_EALG_RC5CBC | ||||
#ifdef SADB_EALG_RC5CBC | #ifdef SADB_EALG_RC5CBC | ||||
#define SADB_X_EALG_RC5CBC SADB_EALG_RC5CBC | #define SADB_X_EALG_RC5CBC SADB_EALG_RC5CBC | ||||
#endif | #endif | ||||
#endif | #endif | ||||
#define GETMSGSTR(str, num) \ | #define GETMSGSTR(str, num) \ | ||||
do { \ | do { \ | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | static char *str_state[] = { | ||||
"larval", | "larval", | ||||
"mature", | "mature", | ||||
"dying", | "dying", | ||||
"dead", | "dead", | ||||
}; | }; | ||||
static struct val2str str_alg_auth[] = { | static struct val2str str_alg_auth[] = { | ||||
{ SADB_AALG_NONE, "none", }, | { SADB_AALG_NONE, "none", }, | ||||
{ SADB_AALG_MD5HMAC, "hmac-md5", }, | |||||
{ SADB_AALG_SHA1HMAC, "hmac-sha1", }, | { SADB_AALG_SHA1HMAC, "hmac-sha1", }, | ||||
{ SADB_X_AALG_MD5, "md5", }, | |||||
{ SADB_X_AALG_SHA, "sha", }, | |||||
{ SADB_X_AALG_NULL, "null", }, | { SADB_X_AALG_NULL, "null", }, | ||||
cem: If we're getting rid of broken authentication algorithms, null jumps out as pretty broken. | |||||
Not Done Inline ActionsWe should keep NULL for testing the framework's speed without any encryption algorithms in the way. gnn: We should keep NULL for testing the framework's speed without any encryption algorithms in the… | |||||
{ SADB_X_AALG_TCP_MD5, "tcp-md5", }, | { SADB_X_AALG_TCP_MD5, "tcp-md5", }, | ||||
#ifdef SADB_X_AALG_SHA2_256 | #ifdef SADB_X_AALG_SHA2_256 | ||||
{ SADB_X_AALG_SHA2_256, "hmac-sha2-256", }, | { SADB_X_AALG_SHA2_256, "hmac-sha2-256", }, | ||||
#endif | #endif | ||||
#ifdef SADB_X_AALG_SHA2_384 | #ifdef SADB_X_AALG_SHA2_384 | ||||
{ SADB_X_AALG_SHA2_384, "hmac-sha2-384", }, | { SADB_X_AALG_SHA2_384, "hmac-sha2-384", }, | ||||
#endif | #endif | ||||
#ifdef SADB_X_AALG_SHA2_512 | #ifdef SADB_X_AALG_SHA2_512 | ||||
{ SADB_X_AALG_SHA2_512, "hmac-sha2-512", }, | { SADB_X_AALG_SHA2_512, "hmac-sha2-512", }, | ||||
#endif | #endif | ||||
#ifdef SADB_X_AALG_RIPEMD160HMAC | |||||
{ SADB_X_AALG_RIPEMD160HMAC, "hmac-ripemd160", }, | |||||
#endif | |||||
#ifdef SADB_X_AALG_AES_XCBC_MAC | #ifdef SADB_X_AALG_AES_XCBC_MAC | ||||
{ SADB_X_AALG_AES_XCBC_MAC, "aes-xcbc-mac", }, | { SADB_X_AALG_AES_XCBC_MAC, "aes-xcbc-mac", }, | ||||
#endif | #endif | ||||
{ -1, NULL, }, | { -1, NULL, }, | ||||
}; | }; | ||||
static struct val2str str_alg_enc[] = { | static struct val2str str_alg_enc[] = { | ||||
{ SADB_EALG_NONE, "none", }, | { SADB_EALG_NONE, "none", }, | ||||
{ SADB_EALG_DESCBC, "des-cbc", }, | |||||
{ SADB_EALG_3DESCBC, "3des-cbc", }, | |||||
{ SADB_EALG_NULL, "null", }, | { SADB_EALG_NULL, "null", }, | ||||
#ifdef SADB_X_EALG_RC5CBC | #ifdef SADB_X_EALG_RC5CBC | ||||
{ SADB_X_EALG_RC5CBC, "rc5-cbc", }, | { SADB_X_EALG_RC5CBC, "rc5-cbc", }, | ||||
#endif | #endif | ||||
{ SADB_X_EALG_CAST128CBC, "cast128-cbc", }, | |||||
{ SADB_X_EALG_BLOWFISHCBC, "blowfish-cbc", }, | |||||
#ifdef SADB_X_EALG_RIJNDAELCBC | #ifdef SADB_X_EALG_RIJNDAELCBC | ||||
{ SADB_X_EALG_RIJNDAELCBC, "rijndael-cbc", }, | { SADB_X_EALG_RIJNDAELCBC, "rijndael-cbc", }, | ||||
#endif | #endif | ||||
#ifdef SADB_X_EALG_TWOFISHCBC | #ifdef SADB_X_EALG_TWOFISHCBC | ||||
{ SADB_X_EALG_TWOFISHCBC, "twofish-cbc", }, | { SADB_X_EALG_TWOFISHCBC, "twofish-cbc", }, | ||||
#endif | #endif | ||||
Not Done Inline Actionstwofish?! cem: twofish?! | |||||
Done Inline ActionsWe don't define the constant, so this is dead code anyway. jhb: We don't define the constant, so this is dead code anyway. | |||||
#ifdef SADB_X_EALG_AESCTR | #ifdef SADB_X_EALG_AESCTR | ||||
{ SADB_X_EALG_AESCTR, "aes-ctr", }, | { SADB_X_EALG_AESCTR, "aes-ctr", }, | ||||
#endif | #endif | ||||
#ifdef SADB_X_EALG_AESGCM16 | #ifdef SADB_X_EALG_AESGCM16 | ||||
{ SADB_X_EALG_AESGCM16, "aes-gcm-16", }, | { SADB_X_EALG_AESGCM16, "aes-gcm-16", }, | ||||
#endif | |||||
#ifdef SADB_X_EALG_CAMELLIACBC | |||||
{ SADB_X_EALG_CAMELLIACBC, "camellia-cbc", }, | |||||
#endif | #endif | ||||
{ -1, NULL, }, | { -1, NULL, }, | ||||
}; | }; | ||||
static struct val2str str_alg_comp[] = { | static struct val2str str_alg_comp[] = { | ||||
{ SADB_X_CALG_NONE, "none", }, | { SADB_X_CALG_NONE, "none", }, | ||||
{ SADB_X_CALG_OUI, "oui", }, | { SADB_X_CALG_OUI, "oui", }, | ||||
{ SADB_X_CALG_DEFLATE, "deflate", }, | { SADB_X_CALG_DEFLATE, "deflate", }, | ||||
▲ Show 20 Lines • Show All 477 Lines • Show Last 20 Lines |
If we're getting rid of broken authentication algorithms, null jumps out as pretty broken. Ditto whatever tcp-md5 is.