| 168 | } |
| 169 | |
| 170 | static int |
| 171 | ossl_newsession(device_t dev, crypto_session_t cses, |
| 172 | const struct crypto_session_params *csp) |
| 173 | { |
| 174 | struct ossl_session *s; |
| 175 | struct auth_hash *axf; |
| 176 | |
| 177 | s = crypto_get_driver_session(cses); |
| 178 | |
| 179 | axf = ossl_lookup_hash(csp); |
| 180 | s->hash.axf = axf; |
| 181 | if (csp->csp_auth_mlen == 0) |
| 182 | s->hash.mlen = axf->hashsize; |
| 183 | else |
| 184 | s->hash.mlen = csp->csp_auth_mlen; |
| 185 | |
| 186 | if (csp->csp_auth_klen == 0) { |
| 187 | axf->Init(&s->hash.ictx); |
| 188 | } else { |
| 189 | if (csp->csp_auth_key != NULL) { |
| 190 | fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); |
| 191 | ossl_setkey_hmac(s, csp->csp_auth_key, |
| 192 | csp->csp_auth_klen); |
| 193 | fpu_kern_leave(curthread, NULL); |
| 194 | } |
| 195 | } |
| 196 | return (0); |
| 197 | } |
| 198 | |
| 199 | static int |
| 200 | ossl_process(device_t dev, struct cryptop *crp, int hint) |
nothing calls this directly
no test coverage detected