File: digest.sh

package info (click to toggle)
dynalogin 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, sid, stretch
  • size: 1,864 kB
  • ctags: 439
  • sloc: sh: 11,691; ansic: 2,552; php: 276; makefile: 103; sql: 13
file content (22 lines) | stat: -rwxr-xr-x 428 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash -x


HOTP_CODE="$1"

USER="tester1"
REALM="testr"
NONCE="0123456789"
METHOD=GET
URL=testlogin.php

HA1=`echo -n "${USER}:${REALM}:${HOTP_CODE}" | md5sum | cut -b1-32`

HA2=`echo -n "${METHOD}:${URL}" | md5sum | cut -b1-32`

RESPONSE=`echo -n "${HA1}:${NONCE}:${HA2}" | md5sum | cut -b1-32`

RESPONSE_SUFFIX="${NONCE}:${HA2}"

echo "user = $USER realm = $REALM suffix = $RESPONSE_SUFFIX"
echo "response = $RESPONSE"