[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: package/win32: only enable the update check when building the GUI
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Jul 5 12:39:23 UTC 2026
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
f47826ce by Steve Lhomme at 2026-07-05T12:26:01+00:00
package/win32: only enable the update check when building the GUI
Otherwise it's not used and should not be used for libvlc apps.
(cherry picked from commit 7a0e5cd4bbe786a00f6044ec1957789e97736e63)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
- - - - -
9f473bd3 by Thomas Guillem at 2026-07-05T12:26:01+00:00
update: use https for Windows >= 7
Not a really clean code, but it's minimal code to have less possible
regressions.
- - - - -
5 changed files:
- extras/package/win32/build.sh
- extras/package/win32/configure.sh
- src/misc/update.c
- src/misc/update.h
- src/misc/update_crypto.c
Changes:
=====================================
extras/package/win32/build.sh
=====================================
@@ -501,7 +501,7 @@ fi
if [ -n "$DISABLEGUI" ]; then
CONFIGFLAGS="$CONFIGFLAGS --disable-vlc --disable-qt --disable-skins2"
else
- CONFIGFLAGS="$CONFIGFLAGS --enable-qt --enable-skins2"
+ CONFIGFLAGS="$CONFIGFLAGS --enable-qt --enable-skins2 --enable-update-check"
fi
if [ -n "$WINSTORE" ]; then
CONFIGFLAGS="$CONFIGFLAGS --enable-winstore-app"
=====================================
extras/package/win32/configure.sh
=====================================
@@ -1,7 +1,6 @@
#!/bin/sh
OPTIONS="
- --enable-update-check
--enable-lua
--enable-faad
--enable-flac
=====================================
src/misc/update.c
=====================================
@@ -82,8 +82,10 @@
#ifndef NDEBUG
# define UPDATE_VLC_STATUS_URL "http://update-test.videolan.org/vlc/status-win-x86"
+# define UPDATE_VLC_STATUS_SURL "https://update-test.videolan.org/vlc/status-win-x86"
#else
# define UPDATE_VLC_STATUS_URL "http://update.videolan.org/vlc/status" UPDATE_OS_SUFFIX
+# define UPDATE_VLC_STATUS_SURL "https://update.videolan.org/vlc/status" UPDATE_OS_SUFFIX
#endif
#define dialog_FatalWait( p_obj, psz_title, psz_fmt, ... ) \
@@ -186,11 +188,14 @@ static bool GetUpdateFile( update_t *p_update )
char *psz_version_line = NULL;
char *psz_update_data = NULL;
- p_stream = vlc_stream_NewURL( p_update->p_libvlc, UPDATE_VLC_STATUS_URL );
+ bool use_https = update_use_https();
+ const char *update_status_url = use_https ? UPDATE_VLC_STATUS_SURL : UPDATE_VLC_STATUS_URL;
+
+ p_stream = vlc_stream_NewURL( p_update->p_libvlc, update_status_url );
if( !p_stream )
{
msg_Err( p_update->p_libvlc, "Failed to open %s for reading",
- UPDATE_VLC_STATUS_URL );
+ update_status_url );
goto error;
}
@@ -209,7 +214,7 @@ static bool GetUpdateFile( update_t *p_update )
i_read ) != (ssize_t)i_read )
{
msg_Err( p_update->p_libvlc, "Couldn't download update file %s",
- UPDATE_VLC_STATUS_URL );
+ update_status_url );
goto error;
}
psz_update_data[i_read] = '\0';
@@ -244,7 +249,7 @@ static bool GetUpdateFile( update_t *p_update )
if( i_len == 0 )
{
msg_Err( p_update->p_libvlc, "Update file %s is corrupted: URL missing",
- UPDATE_VLC_STATUS_URL );
+ update_status_url );
goto error;
}
@@ -264,7 +269,7 @@ static bool GetUpdateFile( update_t *p_update )
{
msg_Err( p_update->p_libvlc,
"Update file %s is corrupted: description missing",
- UPDATE_VLC_STATUS_URL );
+ update_status_url );
goto error;
}
@@ -277,7 +282,7 @@ static bool GetUpdateFile( update_t *p_update )
* to authenticate it */
signature_packet_t sign;
if( download_signature( VLC_OBJECT( p_update->p_libvlc ), &sign,
- UPDATE_VLC_STATUS_URL ) != VLC_SUCCESS )
+ update_status_url ) != VLC_SUCCESS )
{
msg_Err( p_update->p_libvlc, "Couldn't download signature of status file" );
goto error;
=====================================
src/misc/update.h
=====================================
@@ -217,3 +217,5 @@ hash_from_file(
*/
uint8_t *
hash_from_public_key( public_key_t *p_pkey );
+
+bool update_use_https(void);
\ No newline at end of file
=====================================
src/misc/update_crypto.c
=====================================
@@ -925,6 +925,16 @@ uint8_t *hash_from_public_key( public_key_t *p_pkey )
return p_hash;
}
+/* Return true if the OS can handle recent https certs (>= Windows 7) */
+bool update_use_https(void)
+{
+ HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+ bool isWin7OrGreater = false;
+ if (likely(hKernel32 != NULL))
+ isWin7OrGreater = GetProcAddress(hKernel32, "GetLogicalProcessorInformationEx") != NULL;
+
+ return isWin7OrGreater;
+}
/*
* download a public key (the last one) from videolan server, and parse it
@@ -933,7 +943,8 @@ public_key_t *download_key( vlc_object_t *p_this,
const uint8_t *p_longid, const uint8_t *p_signature_issuer )
{
char *psz_url;
- if( asprintf( &psz_url, "http://download.videolan.org/pub/keys/%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X.asc",
+ if( asprintf( &psz_url, "http%s://download.videolan.org/pub/keys/%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X.asc",
+ update_use_https() ? "s" : "",
p_longid[0], p_longid[1], p_longid[2], p_longid[3],
p_longid[4], p_longid[5], p_longid[6], p_longid[7] ) == -1 )
return NULL;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/204f9bddece5f766401a24e5eaaba34995ccf7db...9f473bd370269e5bfe41f38c4011bd65453e8849
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/204f9bddece5f766401a24e5eaaba34995ccf7db...9f473bd370269e5bfe41f38c4011bd65453e8849
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list