Currently, the use of BN_div_word() can result in -0 - avoid this by
setting negative again, at the end of the computation.
Should fix oss-fuzz 56667.
ok tb@
-/* $OpenBSD: bn_word.c,v 1.19 2023/03/11 14:13:11 jsing Exp $ */
+/* $OpenBSD: bn_word.c,v 1.20 2023/03/11 14:14:54 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if ((a->top > 0) && (a->d[a->top - 1] == 0))
a->top--;
ret >>= j;
+
+ /* Set negative again, to handle -0 case. */
+ BN_set_negative(a, a->neg);
+
return (ret);
}