diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2026-04-07 22:35:35 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2026-04-07 22:35:35 +0000 |
| commit | ab5fc4ac933ff67bc800e774dffce15e2a541e90 (patch) | |
| tree | 41fac85d3f2f7d74be9bfce46b1a78ff9897165d /crypto/bio | |
| parent | 808413da28df9fb93e1f304e6016b15e660f54c8 (diff) | |
Diffstat (limited to 'crypto/bio')
| -rw-r--r-- | crypto/bio/bss_dgram.c | 4 | ||||
| -rw-r--r-- | crypto/bio/bss_file.c | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index dd14c393d737..42bb0e861afe 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -961,7 +961,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling setsockopt()"); -#elif defined(OPENSSL_SYS_LINUX) && defined(IPV6_MTU_DISCOVER) +#elif defined(OPENSSL_SYS_LINUX) && defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_PROBE) sockopt_val = num ? IPV6_PMTUDISC_PROBE : IPV6_PMTUDISC_DONT; if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &sockopt_val, sizeof(sockopt_val))) diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index c5bdda498bd0..6b8daeb95f90 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -202,8 +202,19 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_INFO: if (b->flags & BIO_FLAGS_UPLINK_INTERNAL) ret = UP_ftell(b->ptr); - else + else { +#if defined(OPENSSL_SYS_WINDOWS) + /* + * On Windows, for non-seekable files (stdin), ftell() is undefined. + */ + if (GetFileType((HANDLE)_get_osfhandle(_fileno(fp))) != FILE_TYPE_DISK) + ret = -1; + else + ret = ftell(fp); +#else ret = ftell(fp); +#endif + } break; case BIO_C_SET_FILE_PTR: file_free(b); |
