keydb.h (275438) | keydb.h (286292) |
---|---|
1/* $FreeBSD: head/sys/netipsec/keydb.h 275438 2014-12-03 04:08:41Z ae $ */ | 1/* $FreeBSD: head/sys/netipsec/keydb.h 286292 2015-08-04 17:47:11Z jmg $ */ |
2/* $KAME: keydb.h,v 1.14 2000/08/02 17:58:26 sakane Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 107 unchanged lines hidden (view full) --- 117 u_int8_t alg_auth; /* Authentication Algorithm Identifier*/ 118 u_int8_t alg_enc; /* Cipher Algorithm Identifier */ 119 u_int8_t alg_comp; /* Compression Algorithm Identifier */ 120 u_int32_t spi; /* SPI Value, network byte order */ 121 u_int32_t flags; /* holder for SADB_KEY_FLAGS */ 122 123 struct seckey *key_auth; /* Key for Authentication */ 124 struct seckey *key_enc; /* Key for Encryption */ | 2/* $KAME: keydb.h,v 1.14 2000/08/02 17:58:26 sakane Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 107 unchanged lines hidden (view full) --- 117 u_int8_t alg_auth; /* Authentication Algorithm Identifier*/ 118 u_int8_t alg_enc; /* Cipher Algorithm Identifier */ 119 u_int8_t alg_comp; /* Compression Algorithm Identifier */ 120 u_int32_t spi; /* SPI Value, network byte order */ 121 u_int32_t flags; /* holder for SADB_KEY_FLAGS */ 122 123 struct seckey *key_auth; /* Key for Authentication */ 124 struct seckey *key_enc; /* Key for Encryption */ |
125 caddr_t iv; /* Initilization Vector */ | |
126 u_int ivlen; /* length of IV */ 127 void *sched; /* intermediate encryption key */ 128 size_t schedlen; | 125 u_int ivlen; /* length of IV */ 126 void *sched; /* intermediate encryption key */ 127 size_t schedlen; |
128 uint64_t cntr; /* counter for GCM and CTR */ |
|
129 130 struct secreplay *replay; /* replay prevention */ 131 time_t created; /* for lifetime */ 132 133 struct seclifetime *lft_c; /* CURRENT lifetime, it's constant. */ 134 struct seclifetime *lft_h; /* HARD lifetime */ 135 struct seclifetime *lft_s; /* SOFT lifetime */ 136 --- 21 unchanged lines hidden (view full) --- 158}; 159 160#define SECASVAR_LOCK_INIT(_sav) \ 161 mtx_init(&(_sav)->lock, "ipsec association", NULL, MTX_DEF) 162#define SECASVAR_LOCK(_sav) mtx_lock(&(_sav)->lock) 163#define SECASVAR_UNLOCK(_sav) mtx_unlock(&(_sav)->lock) 164#define SECASVAR_LOCK_DESTROY(_sav) mtx_destroy(&(_sav)->lock) 165#define SECASVAR_LOCK_ASSERT(_sav) mtx_assert(&(_sav)->lock, MA_OWNED) | 129 130 struct secreplay *replay; /* replay prevention */ 131 time_t created; /* for lifetime */ 132 133 struct seclifetime *lft_c; /* CURRENT lifetime, it's constant. */ 134 struct seclifetime *lft_h; /* HARD lifetime */ 135 struct seclifetime *lft_s; /* SOFT lifetime */ 136 --- 21 unchanged lines hidden (view full) --- 158}; 159 160#define SECASVAR_LOCK_INIT(_sav) \ 161 mtx_init(&(_sav)->lock, "ipsec association", NULL, MTX_DEF) 162#define SECASVAR_LOCK(_sav) mtx_lock(&(_sav)->lock) 163#define SECASVAR_UNLOCK(_sav) mtx_unlock(&(_sav)->lock) 164#define SECASVAR_LOCK_DESTROY(_sav) mtx_destroy(&(_sav)->lock) 165#define SECASVAR_LOCK_ASSERT(_sav) mtx_assert(&(_sav)->lock, MA_OWNED) |
166#define SAV_ISGCM(_sav) \ 167 ((_sav)->alg_enc == SADB_X_EALG_AESGCM8 || \ 168 (_sav)->alg_enc == SADB_X_EALG_AESGCM12 || \ 169 (_sav)->alg_enc == SADB_X_EALG_AESGCM16) 170#define SAV_ISCTR(_sav) ((_sav)->alg_enc == SADB_X_EALG_AESCTR) 171#define SAV_ISCTRORGCM(_sav) (SAV_ISCTR((_sav)) || SAV_ISGCM((_sav))) |
|
166 167/* replay prevention */ 168struct secreplay { 169 u_int32_t count; 170 u_int wsize; /* window size, i.g. 4 bytes */ 171 u_int32_t seq; /* used by sender */ 172 u_int32_t lastseq; /* used by receiver */ 173 caddr_t bitmap; /* used by receiver */ --- 46 unchanged lines hidden --- | 172 173/* replay prevention */ 174struct secreplay { 175 u_int32_t count; 176 u_int wsize; /* window size, i.g. 4 bytes */ 177 u_int32_t seq; /* used by sender */ 178 u_int32_t lastseq; /* used by receiver */ 179 caddr_t bitmap; /* used by receiver */ --- 46 unchanged lines hidden --- |