-/* $OpenBSD: bn_exp.c,v 1.42 2023/03/27 10:21:23 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.43 2023/03/27 10:22:47 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ret = 1;
err:
- if (r != rr && rr != NULL)
- BN_copy(r, rr);
+ if (r != rr && rr != NULL) {
+ if (!bn_copy(r, rr))
+ ret = 0;
+ }
BN_CTX_end(ctx);
return (ret);
}
-/* $OpenBSD: bn_mul.c,v 1.34 2023/02/22 05:57:19 jsing Exp $ */
+/* $OpenBSD: bn_mul.c,v 1.35 2023/03/27 10:22:47 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_set_negative(rr, a->neg ^ b->neg);
- if (r != rr)
- BN_copy(r, rr);
+ if (r != rr) {
+ if (!bn_copy(r, rr))
+ goto err;
+ }
done:
ret = 1;
err:
-/* $OpenBSD: bn_sqr.c,v 1.27 2023/02/17 05:13:34 jsing Exp $ */
+/* $OpenBSD: bn_sqr.c,v 1.28 2023/03/27 10:22:47 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
rr->neg = 0;
- if (rr != r)
- BN_copy(r, rr);
+ if (rr != r) {
+ if (!bn_copy(r, rr))
+ goto err;
+ }
done:
ret = 1;
-/* $OpenBSD: rsa_gen.c,v 1.26 2022/11/26 16:08:54 tb Exp $ */
+/* $OpenBSD: rsa_gen.c,v 1.27 2023/03/27 10:22:47 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (!rsa->iqmp && ((rsa->iqmp = BN_new()) == NULL))
goto err;
- BN_copy(rsa->e, e_value);
+ if (!bn_copy(rsa->e, e_value))
+ goto err;
/* generate p and q */
for (;;) {