Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkgbuilds/sunshine/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = sunshine
pkgdesc = Self-hosted game stream host for Moonlight
pkgver = 2026.914.233613
pkgrel = 1
pkgrel = 2
url = https://app.lizardbyte.dev/Sunshine
install = sunshine.install
arch = x86_64
Expand Down Expand Up @@ -50,6 +50,12 @@ pkgbase = sunshine
optdepends = cuda: Nvidia GPU encoding support
optdepends = libva-mesa-driver: AMD GPU encoding support
source = sunshine::git+https://github.com/LizardByte/Sunshine.git#commit=63d35f702ee9e362e43263742981836ec0710384
source = 2026.914.233613-dac66dfd-openssl-4.1-signature-length.patch
source = 2026.914.233613-6005-openssl-crypto-tests.patch
source = 2026.914.233613-357bd98c-update-metainfo-urls.patch
sha256sums = SKIP
sha256sums = 0a31ccdf628f13fcdc30dac2283f565b3ab6df295b3c21c7a7514f2925549eb8
sha256sums = b311d1aaab26503232bd3439ec2073cedb1d83db946ca1c8fe3e894a7729270d
sha256sums = 3208f0e7ec1a748e5f5e5a0994f62c5479aea6e94804983876313a0734efb98c

pkgname = sunshine
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/packaging/linux/dev.lizardbyte.app.Sunshine.metainfo.xml b/packaging/linux/dev.lizardbyte.app.Sunshine.metainfo.xml
--- a/packaging/linux/dev.lizardbyte.app.Sunshine.metainfo.xml
+++ b/packaging/linux/dev.lizardbyte.app.Sunshine.metainfo.xml
@@ -16,7 +16,7 @@
</supports>

<url type="homepage">@PROJECT_HOMEPAGE_URL@</url>
- <url type="bugtracker">https://github.com/LizardByte/Sunshine/issues</url>
+ <url type="bugtracker">https://github.com/SunshineStream/Sunshine/issues</url>
<url type="faq">https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2troubleshooting.html</url>
<url type="help">https://docs.lizardbyte.dev/projects/sunshine</url>
<url type="donation">https://app.lizardbyte.dev/#Donate</url>
@@ -35,7 +35,7 @@

<releases>
<release version="@PROJECT_VERSION@" date="@PROJECT_YEAR@-@PROJECT_MONTH@-@PROJECT_DAY@">
- <url>https://github.com/LizardByte/Sunshine/releases/tag/v@PROJECT_VERSION@</url>
+ <url>https://github.com/SunshineStream/Sunshine/releases/tag/v@PROJECT_VERSION@</url>
<description>
<p>See the changelog on GitHub</p>
</description>
@@ -47,7 +47,7 @@
</developer>
<screenshots>
<screenshot type="default">
- <image>https://app.lizardbyte.dev/Sunshine/assets/img/screenshots/01-sunshine-welcome-page.png</image>
+ <image>https://sunshine.lizardbyte.dev/assets/sunshine-web-ui-light.jpg</image>
<caption>Sunshine welcome page</caption>
</screenshot>
</screenshots>
95 changes: 95 additions & 0 deletions pkgbuilds/sunshine/2026.914.233613-6005-openssl-crypto-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
diff --git a/src/crypto.h b/src/crypto.h
--- a/src/crypto.h
+++ b/src/crypto.h
@@ -150,10 +150,10 @@
creds_t gen_creds(const std::string_view &cn, std::uint32_t key_bits);

/**
- * @brief Return the certificate signature bytes.
- *
- * @param x Certificate object or PEM text, depending on the overload.
- * @return Parsed or generated OpenSSL object or PEM data.
+ * @brief Return the certificate signature bytes using the available OpenSSL length API.
+ *
+ * @param x Certificate containing the signature.
+ * @return A view of the binary signature owned by the certificate.
*/
std::string_view signature(const x509_t &x);

diff --git a/tests/unit/test_crypto.cpp b/tests/unit/test_crypto.cpp
--- a/tests/unit/test_crypto.cpp
+++ b/tests/unit/test_crypto.cpp
@@ -4,6 +4,10 @@
*/
// test includes
#include "../tests_common.h"
+
+// standard includes
+#include <string_view>
+#include <vector>

// lib includes
#include <openssl/x509.h>
@@ -31,16 +35,21 @@

const auto common_name_index = X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
ASSERT_GE(common_name_index, 0);
-
const auto common_name_entry = X509_NAME_get_entry(subject, common_name_index);
ASSERT_NE(common_name_entry, nullptr);
-
const auto common_name_data = X509_NAME_ENTRY_get_data(common_name_entry);
ASSERT_NE(common_name_data, nullptr);

+ unsigned char *common_name_utf8 = nullptr;
+ const auto free_common_name = util::fail_guard([&common_name_utf8] {
+ OPENSSL_free(common_name_utf8);
+ });
+ const auto common_name_length = ASN1_STRING_to_UTF8(&common_name_utf8, common_name_data);
+ ASSERT_GE(common_name_length, 0);
+ ASSERT_NE(common_name_utf8, nullptr);
const std::string_view parsed_common_name {
- reinterpret_cast<const char *>(ASN1_STRING_get0_data(common_name_data)),
- static_cast<std::size_t>(ASN1_STRING_length(common_name_data))
+ reinterpret_cast<const char *>(common_name_utf8),
+ static_cast<std::size_t>(common_name_length)
};
ASSERT_EQ(parsed_common_name, common_name);

@@ -49,6 +58,36 @@
const auto signature = crypto::sign256(pkey, payload);
ASSERT_FALSE(signature.empty());
ASSERT_TRUE(crypto::verify256(cert, payload, {reinterpret_cast<const char *>(signature.data()), signature.size()}));
+}
+
+TEST(CryptoTest, CertificateSignaturePreservesBinaryBytes) {
+ constexpr std::uint32_t key_bits = 2048;
+ const auto creds = crypto::gen_creds("Sunshine Signature Test", key_bits);
+ const auto cert = crypto::x509(creds.x509);
+ ASSERT_NE(cert.get(), nullptr);
+
+ const auto der_size = i2d_X509(cert.get(), nullptr);
+ ASSERT_GT(der_size, 0);
+ std::vector<unsigned char> der(static_cast<std::size_t>(der_size));
+ auto *write_cursor = der.data();
+ ASSERT_EQ(i2d_X509(cert.get(), &write_cursor), der_size);
+
+ // The final DER field contains the RSA signature. Include every byte value,
+ // including embedded NULs, to verify that extraction preserves binary data.
+ constexpr std::size_t signature_size = key_bits / 8;
+ ASSERT_GT(der.size(), signature_size);
+ for (std::size_t i = 0; i < signature_size; ++i) {
+ der[der.size() - signature_size + i] = static_cast<unsigned char>(i);
+ }
+
+ const auto *read_cursor = der.data();
+ const crypto::x509_t binary_cert {d2i_X509(nullptr, &read_cursor, der_size)};
+ ASSERT_NE(binary_cert.get(), nullptr);
+ const std::string_view expected_signature {
+ reinterpret_cast<const char *>(der.data() + der.size() - signature_size),
+ signature_size
+ };
+ EXPECT_EQ(crypto::signature(binary_cert), expected_signature);
}

TEST(CryptoTest, CertificateChainRequiresExactPairedIdentity) {
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/crypto.cpp b/src/crypto.cpp
--- a/src/crypto.cpp
+++ b/src/crypto.cpp
@@ -412,9 +412,15 @@
const ASN1_BIT_STRING *asn1 = nullptr;
X509_get0_signature(&asn1, nullptr, x.get());

+#if OPENSSL_VERSION_NUMBER >= 0x40100000L
+ const auto length = ASN1_STRING_get_length(asn1);
+#else
+ const auto length = static_cast<std::size_t>(ASN1_STRING_length(asn1));
+#endif
+
return {
reinterpret_cast<const char *>(ASN1_STRING_get0_data(asn1)),
- static_cast<std::size_t>(ASN1_STRING_length(asn1))
+ length
};
}

27 changes: 24 additions & 3 deletions pkgbuilds/sunshine/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

pkgname='sunshine'
pkgver=2026.914.233613
pkgrel=1
pkgrel=2
pkgdesc="Self-hosted game stream host for Moonlight"
arch=('x86_64' 'aarch64')
url=https://app.lizardbyte.dev/Sunshine
Expand Down Expand Up @@ -84,8 +84,18 @@ optdepends=(
provides=()
conflicts=()

source=("$pkgname::git+https://github.com/LizardByte/Sunshine.git#commit=${_commit}")
sha256sums=('SKIP')
source=(
"$pkgname::git+https://github.com/LizardByte/Sunshine.git#commit=${_commit}"
'2026.914.233613-dac66dfd-openssl-4.1-signature-length.patch'
'2026.914.233613-6005-openssl-crypto-tests.patch'
'2026.914.233613-357bd98c-update-metainfo-urls.patch'
)
sha256sums=(
'SKIP'
'0a31ccdf628f13fcdc30dac2283f565b3ab6df295b3c21c7a7514f2925549eb8'
'b311d1aaab26503232bd3439ec2073cedb1d83db946ca1c8fe3e894a7729270d'
'3208f0e7ec1a748e5f5e5a0994f62c5479aea6e94804983876313a0734efb98c'
)

# Options Handling
if [[ "${_use_cuda::1}" == "d" ]] && pacman -Qi cuda &> /dev/null; then
Expand Down Expand Up @@ -120,6 +130,17 @@ fi
prepare() {
cd "$pkgname"
git submodule update --recursive --init --depth 1

# Backport https://github.com/SunshineStream/Sunshine/commit/dac66dfdd200c5f1bb4b31b4e34227690ca8c565
patch -Np1 -i "${srcdir}/2026.914.233613-dac66dfd-openssl-4.1-signature-length.patch"

# Backport the regression test and supported subject-name API from:
# https://github.com/SunshineStream/Sunshine/pull/6005
patch -Np1 -i "${srcdir}/2026.914.233613-6005-openssl-crypto-tests.patch"

# Backport the metainfo changes from:
# https://github.com/SunshineStream/Sunshine/commit/357bd98cb1e203dbacbd831dbc6ddfac76d22ac0
patch -Np1 -i "${srcdir}/2026.914.233613-357bd98c-update-metainfo-urls.patch"
}

build() {
Expand Down
Loading