Fixes #19812
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19817)
# include <openssl/bio.h>
# include "internal/e_os.h"
+# ifndef timersub
+/* struct timeval * subtraction; a must be greater than or equal to b */
+# define timersub(a, b, res) \
+ do { \
+ (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ if ((a)->tv_usec < (b)->tv_usec) { \
+ (res)->tv_usec = (a)->tv_usec + 1000000 - (b)->tv_usec); \
+ --(res)->tv_sec; \
+ } else { \
+ (res)->tv_usec = (a)->tv_usec - (b)->tv_usec); \
+ } \
+ } while(0)
+# endif
+
static char *prog;
static void readx509(const char *contents, int size)