MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ossl_newsession

Function ossl_newsession

freebsd/crypto/openssl/ossl.c:170–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170static int
171ossl_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
199static int
200ossl_process(device_t dev, struct cryptop *crp, int hint)

Callers

nothing calls this directly

Calls 6

ossl_lookup_hashFunction · 0.85
ossl_setkey_hmacFunction · 0.85
InitMethod · 0.80
fpu_kern_enterFunction · 0.50
fpu_kern_leaveFunction · 0.50

Tested by

no test coverage detected