Skip to content

Commit 6a2cedf

Browse files
aledbfclaude
andcommitted
code: extensions verify against OpenSSL 4
vsce-sign, which checks the signature of every extension the marketplace sends, is .NET, and .NET looks for OpenSSL 3 or older by name. The root had OpenSSL 3 only because four recipes built against it pulled it in; built against OpenSSL 4 they no longer do, and Code refused every extension: "Signature verification failed with 'UnknownError' error" (vsce-sign: "No usable version of libssl was found"). CLR_OPENSSL_VERSION_OVERRIDE=4 makes .NET open OpenSSL 4, and vsce-sign verifies as it did with 3: a genuine package passes, one with a changed file is refused with the same error. Code passes its environment to its children, so /usr/bin/code and the desktop files set it; nothing else on the machine does, since a Flatpak's .NET has its runtime's OpenSSL 3. Checked on the root task lock built: code --install-extension ms-vscode.wordcount fails through Microsoft's script and installs through /usr/bin/code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a28fa5b commit 6a2cedf

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎image/apko.lock.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ contents:
2222
- bluez-doc=5.87-r3
2323
- bolt=0.9.11-r1
2424
- ccid=1.8.4-r0
25-
- code=1.140.0-r3
25+
- code=1.140.0-r4
2626
- colord=1.4.8-r0
2727
- colord-gtk=0.3.1-r0
2828
- construct-brand=0_git20261005-r1

‎recipes/code.yaml‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package:
77
name: code
88
version: 1.140.0
9-
epoch: 3
9+
epoch: 4
1010
description: Visual Studio Code, Microsoft's build
1111
copyright:
1212
- license: LicenseRef-Microsoft-VSCode
@@ -49,15 +49,26 @@ pipeline:
4949
# the browser.
5050
rm ${{targets.destdir}}/usr/share/code/resources/app/extensions/microsoft-authentication/dist/libmsalruntime.so \
5151
${{targets.destdir}}/usr/share/code/resources/app/extensions/microsoft-authentication/dist/msal-node-runtime.node
52-
ln -s ../share/code/bin/code ${{targets.destdir}}/usr/bin/code
52+
# vsce-sign, which verifies every extension the marketplace sends, is .NET, and .NET looks
53+
# for OpenSSL 3 or older by name: on a root with only OpenSSL 4 it aborts ("No usable version
54+
# of libssl was found") and no extension installs. Told the version, .NET opens OpenSSL 4,
55+
# and verifies as it did with 3: a genuine package passes, a changed one is refused. Code
56+
# passes its environment to its children, so both ways in - the command and the desktop
57+
# files - set it, and nothing else on the machine gets it: a Flatpak's .NET, whose runtime
58+
# has OpenSSL 3, would not open it.
59+
install -Dm755 /dev/stdin ${{targets.destdir}}/usr/bin/code <<'WRAPPER'
60+
#!/bin/sh
61+
export CLR_OPENSSL_VERSION_OVERRIDE=4
62+
exec /usr/share/code/bin/code "$@"
63+
WRAPPER
5364
install -Dm644 ${{targets.destdir}}/usr/share/code/resources/app/out/media/code-icon.svg \
5465
${{targets.destdir}}/usr/share/icons/hicolor/scalable/apps/vscode.svg
5566
install -Dm644 /dev/stdin ${{targets.destdir}}/usr/share/applications/code.desktop <<'EOF'
5667
[Desktop Entry]
5768
Name=Visual Studio Code
5869
Comment=Code Editing. Redefined.
5970
GenericName=Text Editor
60-
Exec=/usr/share/code/code %F
71+
Exec=env CLR_OPENSSL_VERSION_OVERRIDE=4 /usr/share/code/code %F
6172
Icon=vscode
6273
Type=Application
6374
StartupNotify=false
@@ -69,15 +80,15 @@ pipeline:
6980
7081
[Desktop Action new-empty-window]
7182
Name=New Empty Window
72-
Exec=/usr/share/code/code --new-window %F
83+
Exec=env CLR_OPENSSL_VERSION_OVERRIDE=4 /usr/share/code/code --new-window %F
7384
Icon=vscode
7485
EOF
7586
install -Dm644 /dev/stdin ${{targets.destdir}}/usr/share/applications/code-url-handler.desktop <<'EOF'
7687
[Desktop Entry]
7788
Name=Visual Studio Code - URL Handler
7889
Comment=Code Editing. Redefined.
7990
GenericName=Text Editor
80-
Exec=/usr/share/code/code --open-url %U
91+
Exec=env CLR_OPENSSL_VERSION_OVERRIDE=4 /usr/share/code/code --open-url %U
8192
Icon=vscode
8293
Type=Application
8394
NoDisplay=true
@@ -87,3 +98,4 @@ pipeline:
8798
Keywords=vscode;
8899
EOF
89100
test -x ${{targets.destdir}}/usr/share/code/code
101+
test "$(grep -c '^Exec=env CLR_OPENSSL_VERSION_OVERRIDE=4 ' ${{targets.destdir}}/usr/share/applications/code*.desktop | awk -F: '{n+=$2} END {print n}')" = 3

0 commit comments

Comments
 (0)