diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-17 12:15:58 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-17 12:15:58 +0200 |
| commit | a01bcfdd29496fc6047f5f710bd5ef81b9841536 (patch) | |
| tree | d6db212240df5ac436043be65d145410915a0d95 /desktop/island/obs-auth.sh | |
| parent | 59fc42e0e23911abeec84fb3bc6c2fcf77ae08c6 (diff) | |
| download | quickshell-a01bcfdd29496fc6047f5f710bd5ef81b9841536.tar.gz quickshell-a01bcfdd29496fc6047f5f710bd5ef81b9841536.zip | |
island: obs-websocket auth helper
Diffstat (limited to 'desktop/island/obs-auth.sh')
| -rwxr-xr-x | desktop/island/obs-auth.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/desktop/island/obs-auth.sh b/desktop/island/obs-auth.sh new file mode 100755 index 0000000..8be20f0 --- /dev/null +++ b/desktop/island/obs-auth.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2026 Danilo M. <danix@danix.xyz> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program 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 General Public License for more details. +# +# obs-websocket v5 authentication, which QML cannot compute: it has no +# SHA256. stdin is two lines, password+salt then challenge, so neither +# reaches a command line. stdout is +# base64(sha256(base64(sha256(password + salt)) + challenge)) + +read -r ps || exit 1 +read -r ch || exit 1 +secret=$(printf %s "$ps" | openssl dgst -sha256 -binary | base64) +printf %s "$secret$ch" | openssl dgst -sha256 -binary | base64 |
