summary refs log tree commit diff
path: root/develop/print.html
diff options
context:
space:
mode:
authorsquahtx <squahtx@users.noreply.github.com>2022-08-11 20:10:43 +0000
committersquahtx <squahtx@users.noreply.github.com>2022-08-11 20:10:43 +0000
commit00ad76e3322697ea6c6f9019b0df0d50a2e894d9 (patch)
treeb74ef795fcacbf08b9bc463a97907845ab64dd53 /develop/print.html
parentdeploy: 953df2ad88fb9fc7d1a67966c79980136321119d (diff)
downloadsynapse-00ad76e3322697ea6c6f9019b0df0d50a2e894d9.tar.xz
deploy: e825f7366b589f61977f63d4fdc598abe052e6a0
Diffstat (limited to 'develop/print.html')
-rw-r--r--develop/print.html15
1 files changed, 14 insertions, 1 deletions
diff --git a/develop/print.html b/develop/print.html
index 33b096f578..40cf732869 100644
--- a/develop/print.html
+++ b/develop/print.html
@@ -10852,7 +10852,20 @@ set the displayname (optional, <code>username</code> by default).</p>
 <p>The MAC is the hex digest output of the HMAC-SHA1 algorithm, with the key being
 the shared secret and the content being the nonce, user, password, either the
 string &quot;admin&quot; or &quot;notadmin&quot;, and optionally the user_type
-each separated by NULs. For an example of generation in Python:</p>
+each separated by NULs.</p>
+<p>Here is an easy way to generate the HMAC digest if you have Bash and OpenSSL:</p>
+<pre><code class="language-bash"># Update these values and then paste this code block into a bash terminal
+nonce='thisisanonce'
+username='pepper_roni'
+password='pizza'
+admin='admin'
+secret='shared_secret'
+
+printf '%s\0%s\0%s\0%s' &quot;$nonce&quot; &quot;$username&quot; &quot;$password&quot; &quot;$admin&quot; |
+  openssl sha1 -hmac &quot;$secret&quot; |
+  awk '{print $2}'
+</code></pre>
+<p>For an example of generation in Python:</p>
 <pre><code class="language-python">import hmac, hashlib
 
 def generate_mac(nonce, user, password, admin=False, user_type=None):