Ensure the NonStop fallback state does not leak across calls by clearing hpns_connect_attempt at the beginning of RAND_query_egd_bytes and after a successful connect. No impact on other platforms.
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu Mar 12 18:22:00 2026
(Merged from https://github.com/openssl/openssl/pull/28909)
struct sockaddr_un addr;
int mybuffer, ret = -1, i, numbytes, fd = -1;
unsigned char tempbuf[255];
+#if defined(OPENSSL_SYS_TANDEM)
+ hpns_connect_attempt = 0;
+#endif
if (bytes <= 0 || bytes > (int)sizeof(tempbuf))
return -1;
/* Try to connect */
for (;;) {
- if (connect(fd, (struct sockaddr *)&addr, i) == 0)
+ if (connect(fd, (struct sockaddr *)&addr, i) == 0) {
+#if defined(OPENSSL_SYS_TANDEM)
+ hpns_connect_attempt = 0;
+#endif
break;
-#ifdef EISCONN
+ }
+# ifdef EISCONN
if (errno == EISCONN)
break;
#endif