-/* $OpenBSD: pk7_doit.c,v 1.51 2023/02/16 08:38:17 tb Exp $ */
+/* $OpenBSD: pk7_doit.c,v 1.52 2023/03/09 18:20:10 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
BIO *btmp;
const EVP_MD *md;
+
if ((btmp = BIO_new(BIO_f_md())) == NULL) {
PKCS7error(ERR_R_BIO_LIB);
goto err;
goto err;
}
- BIO_set_md(btmp, md);
+ if (BIO_set_md(btmp, md) <= 0) {
+ PKCS7error(ERR_R_BIO_LIB);
+ goto err;
+ }
+
if (*pbio == NULL)
*pbio = btmp;
else if (!BIO_push(*pbio, btmp)) {
goto err;
}
- BIO_set_md(btmp, evp_md);
+ if (BIO_set_md(btmp, evp_md) <= 0) {
+ PKCS7error(ERR_R_BIO_LIB);
+ goto err;
+ }
if (out == NULL)
out = btmp;
else