#!/bin/sh # # Copyright (C) 2026 Danilo M. # # 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