* ah_init() is called when an SPI is being set up. */
| 229 | * ah_init() is called when an SPI is being set up. |
| 230 | */ |
| 231 | static int |
| 232 | ah_init(struct secasvar *sav, struct xformsw *xsp) |
| 233 | { |
| 234 | struct crypto_session_params csp; |
| 235 | int error; |
| 236 | |
| 237 | memset(&csp, 0, sizeof(csp)); |
| 238 | csp.csp_mode = CSP_MODE_DIGEST; |
| 239 | |
| 240 | if (sav->flags & SADB_X_SAFLAGS_ESN) |
| 241 | csp.csp_flags |= CSP_F_ESN; |
| 242 | |
| 243 | error = ah_init0(sav, xsp, &csp); |
| 244 | return error ? error : |
| 245 | crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); |
| 246 | } |
| 247 | |
| 248 | static void |
| 249 | ah_cleanup(struct secasvar *sav) |
nothing calls this directly
no test coverage detected