Compare commits

..
Author SHA1 Message Date
Cameron Gutman f018a71a8a Override NSApplicationUpdateCycleEnabled to fix reduced mouse polling rate
Apps built with the macOS 26+ SDK default to an event loop synchronized to the display which caps input polling rates.

We have to use the plist for the opt-out, since NSApp is already set up by Qt before SDL can set this default.

Fixes #2036
2026-10-17 14:06:10 -05:00
Cameron Gutman b0af84ead1 Deploy the OpenSSL TLS backend for Qt
It supports TLS 1.3 and PQ-KEX back to Windows 10, unlike Schannel
2026-10-14 02:01:01 -05:00
Cameron Gutman 289782c6f3 Fix possible UB shift in bs_write_u() for large values of n 2026-10-14 01:51:15 -05:00
Cameron Gutman ee557e83c6 Include the trailing 16 bytes in the challengeResponseData check 2026-10-14 01:49:44 -05:00
Cameron Gutman 2bd4b9f721 Add missing checks for X509 parsing failures 2026-10-14 01:39:00 -05:00
Cameron Gutman fa6ae80940 Clamp additional values that can be used as array indices
These aren't exploitable in moonlight due to clamping done on the read side.
2026-10-14 01:09:54 -05:00
Cameron Gutman 71c3191e0c Remove warn_off for h264bitstream 2026-10-12 02:31:48 -05:00
Cameron Gutman a614924502 Don't hardcode the QSslKey algorithm 2026-10-12 02:31:21 -05:00
Cameron Gutman a57e947d71 Re-add the h264bitstream file headers mistakenly removed during vendoring 2026-10-07 20:19:06 -05:00
10 changed files with 116 additions and 9 deletions
+2
View File
@@ -8,6 +8,8 @@
<string>Moonlight</string>
<key>LSSupportsGameMode</key>
<true/>
<key>NSApplicationUpdateCycleEnabled</key>
<false/>
<key>CFBundleGetInfoString</key>
<string>Stream games and other applications from another PC</string>
<key>CFBundleIconFile</key>
+1 -1
View File
@@ -186,7 +186,7 @@ IdentityManager::getSslKey()
BUF_MEM* mem;
BIO_get_mem_ptr(bio, &mem);
m_CachedSslKey = QSslKey(QByteArray(mem->data, (int)mem->length), QSsl::Rsa);
m_CachedSslKey = QSslKey(QByteArray(mem->data, (int)mem->length), getSslCertificate().publicKey().algorithm());
BIO_free(bio);
EVP_PKEY_free(pk);
+11 -2
View File
@@ -140,6 +140,9 @@ NvPairingManager::getSignatureFromPemCert(const QByteArray& certificate)
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
BIO_free_all(bio);
if (cert == nullptr) {
return QByteArray();
}
QByteArray signature = getSignatureFromCert(cert);
X509_free(cert);
@@ -159,9 +162,15 @@ NvPairingManager::verifySignature(const QByteArray& data, const QByteArray& sign
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
BIO_free_all(bio);
if (cert == nullptr) {
return false;
}
EVP_PKEY* pubKey = X509_get_pubkey(cert);
THROW_BAD_ALLOC_IF_NULL(pubKey);
if (pubKey == nullptr) {
X509_free(cert);
return false;
}
EVP_MD_CTX* mdctx = EVP_MD_CTX_create();
THROW_BAD_ALLOC_IF_NULL(mdctx);
@@ -278,7 +287,7 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
}
QByteArray challengeResponseData = decrypt(m_Http.getXmlStringFromHex(challengeXml, "challengeresponse"), aesKey);
if (challengeResponseData.size() < hashLength) {
if (challengeResponseData.size() < hashLength + 16) {
qCritical() << "Invalid challengeresponse at stage #2";
m_Http.openConnectionToString(m_Http.m_BaseUrlHttp, "unpair", nullptr, REQUEST_TIMEOUT_MS);
return PairState::FAILED;
+23 -1
View File
@@ -1,3 +1,25 @@
/*
* h264bitstream - a library for reading and writing H.264 video
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
* Copyright (C) 2008-2011 Avail-TVN
*
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _H264_BS_H
#define _H264_BS_H 1
@@ -186,7 +208,7 @@ static inline void bs_write_u(bs_t* b, int n, uint32_t v)
int i;
for (i = 0; i < n; i++)
{
bs_write_u1(b, (v >> ( n - i - 1 ))&0x01 );
bs_write_u1(b, (n - i - 1 >= 32) ? 0 : ((v >> ( n - i - 1 ))&0x01) );
}
}
+22
View File
@@ -1,3 +1,25 @@
/*
* h264bitstream - a library for reading and writing H.264 video
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
* Copyright (C) 2008-2011 Avail-TVN
*
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include <stdlib.h>
+33
View File
@@ -1,3 +1,26 @@
/*
* h264bitstream - a library for reading and writing H.264 video
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
* Copyright (C) 2008-2011 Avail-TVN
* Copyright (C) 2012 Alex Izvorski
*
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
@@ -361,6 +384,11 @@ void write_seq_parameter_set_rbsp(sps_t* sps, bs_t* b)
}
else if( sps->pic_order_cnt_type == 1 )
{
if (sps->num_ref_frames_in_pic_order_cnt_cycle > 256)
{
sps->num_ref_frames_in_pic_order_cnt_cycle = 256;
}
bs_write_u1(b, sps->delta_pic_order_always_zero_flag);
bs_write_se(b, sps->offset_for_non_ref_pic);
bs_write_se(b, sps->offset_for_top_to_bottom_field);
@@ -506,6 +534,11 @@ void write_vui_parameters(sps_t* sps, bs_t* b)
void write_hrd_parameters(hrd_t* hrd, bs_t* b)
{
if (hrd->cpb_cnt_minus1 > 31)
{
hrd->cpb_cnt_minus1 = 31;
}
bs_write_ue(b, hrd->cpb_cnt_minus1);
bs_write_u(b, 4, hrd->bit_rate_scale);
bs_write_u(b, 4, hrd->cpb_size_scale);
+22
View File
@@ -1,3 +1,25 @@
/*
* h264bitstream - a library for reading and writing H.264 video
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
* Copyright (C) 2008-2011 Avail-TVN
*
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _H264_STREAM_H
#define _H264_STREAM_H 1
-3
View File
@@ -13,9 +13,6 @@ TEMPLATE = lib
# Build a static library
CONFIG += staticlib
# Disable warnings
CONFIG += warn_off
# Include global qmake defs
include(../globaldefs.pri)
+1 -1
View File
@@ -250,7 +250,7 @@ if not x%QT_PATH:\5.=%==x%QT_PATH% (
set WINDEPLOYQT_ARGS=--no-qmltooling --no-virtualkeyboard
) else (
rem Qt 6.8+
set WINDEPLOYQT_ARGS=--no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types qmltooling,generic --no-ffmpeg
set WINDEPLOYQT_ARGS=--no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types qmltooling,generic --no-ffmpeg --force-openssl
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusion --no-quickcontrols2imagine --no-quickcontrols2universal
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusionstyleimpl --no-quickcontrols2imaginestyleimpl --no-quickcontrols2universalstyleimpl --no-quickcontrols2windowsstyleimpl --no-quickcontrols2fluentwinui3styleimpl
)