Lines Matching refs:inlen
201 const unsigned char *in, size_t inlen, in kek_unwrap_key() argument
211 if (inlen < 2 * blocklen) { in kek_unwrap_key()
215 if (inlen % blocklen) { in kek_unwrap_key()
219 if ((tmp = OPENSSL_malloc(inlen)) == NULL) in kek_unwrap_key()
222 if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, in kek_unwrap_key()
223 in + inlen - 2 * blocklen, blocklen * 2) in kek_unwrap_key()
230 tmp + inlen - blocklen, blocklen) in kek_unwrap_key()
232 || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) in kek_unwrap_key()
237 || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) in kek_unwrap_key()
244 if (inlen < (size_t)(tmp[0] - 4)) { in kek_unwrap_key()
252 OPENSSL_clear_free(tmp, inlen); in kek_unwrap_key()
258 const unsigned char *in, size_t inlen, in kek_wrap_key() argument
272 olen = (inlen + 4 + blocklen - 1) / blocklen; in kek_wrap_key()
278 if (inlen > 0xFF) { in kek_wrap_key()
284 out[0] = (unsigned char)inlen; in kek_wrap_key()
288 memcpy(out + 4, in, inlen); in kek_wrap_key()
290 if (olen > inlen + 4 in kek_wrap_key()
291 && RAND_bytes_ex(ossl_cms_ctx_get0_libctx(cms_ctx), out + 4 + inlen, in kek_wrap_key()
292 olen - 4 - inlen, 0) <= 0) in kek_wrap_key()