help-gsasl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to test SCRAM-SHA-1-PLUS and channel bindings


From: Simon Josefsson
Subject: How to test SCRAM-SHA-1-PLUS and channel bindings
Date: Sun, 14 Nov 2010 02:30:38 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Here is a step-by-step guide on testing SCRAM-SHA-1-PLUS support.
First, you need just released 1.5.4 or a later v1.5.x branch.

Open two terminals.  Below, lines prefixed with T1 is the client running
in the first terminal, lines prefixed with T2 is the server running in
the second terminal.

T1: address@hidden:~$ LANG=C gsasl --client --mechanism SCRAM-SHA-1-PLUS
T1: Enter base64 encoded tls-unique channel binding: 

Gsasl is now waiting for you to enter base64 encoded CB, which is a bit
silly since there is no TLS channel present, but it is useful for
testing.  Type 'b64d' which is valid base64 data, like this:

T1: Enter base64 encoded tls-unique channel binding: b64d
T1: Using mechanism:
T1: SCRAM-SHA-1-PLUS
T1: Using system username `jas' as authentication identity.
T1: Output from client:
T1: cD10bHMtdW5pcXVlLCxuPWphcyxyPWI5ejA4Z05GZEZJL2tBK1oyNFNYWE56OQ==
T1: Enter base64 authentication data from server (press RET if none):

If you want, you can base64 decode the client-first data at this point
to read it in clear text:

address@hidden:~$ echo 
cD10bHMtdW5pcXVlLCxuPWphcyxyPWI5ejA4Z05GZEZJL2tBK1oyNFNYWE56OQ==|base64 -d; echo
p=tls-unique,,n=jas,r=b9z08gNFdFI/kA+Z24SXXNz9
address@hidden:~$ 

Now start the server in the second terminal:

T2: address@hidden:~$ LANG=C gsasl --server --mechanism SCRAM-SHA-1-PLUS
T2: Enter base64 encoded tls-unique channel binding: 

It is also waiting for CB data, so type the same string...

T2: Enter base64 encoded tls-unique channel binding: b64d
T2: Using mechanism:
T2: SCRAM-SHA-1-PLUS
T2: Output from server:
T2: 
T2: Enter base64 authentication data from client (press RET if none):

It is now waiting for the client data, which we had above, so enter it:

T2: cD10bHMtdW5pcXVlLCxuPWphcyxyPWI5ejA4Z05GZEZJL2tBK1oyNFNYWE56OQ==
T2: Output from server:
T2: 
cj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscz1wQWdkRlE5UFRmOWdyR3ZULGk9NDA5Ng==
T2: Enter base64 authentication data from client (press RET if none):

Base64 decoding the server-first message like this:

address@hidden:~$ echo 
cj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscz1wQWdkRlE5UFRmOWdyR3ZULGk9NDA5Ng==|base64
 -d; echo
r=b9z08gNFdFI/kA+Z24SXXNz9zFRgXCX2HUygzveHp7,s=pAgdFQ9PTf9grGvT,i=4096
address@hidden:~$ 

Now type the server blob back into the client:

T1: 
cj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscz1wQWdkRlE5UFRmOWdyR3ZULGk9NDA5Ng==
T1: Enter password: 

It now wants a password, I just type 'gsasl' and it proceeds:

T1: Output from client:
T1: 
Yz1jRDEwYkhNdGRXNXBjWFZsTEN4dnJoMD0scj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscD1hYnl0VVE2UnJ4M2lpdFRoWlE5U2pnQ2dId1U9
T1: Enter base64 authentication data from server (press RET if none):

You can base64 decode this client-final message like this:

address@hidden:~$ echo 
Yz1jRDEwYkhNdGRXNXBjWFZsTEN4dnJoMD0scj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscD1hYnl0VVE2UnJ4M2lpdFRoWlE5U2pnQ2dId1U9|base64
 -d; echo
c=cD10bHMtdW5pcXVlLCxvrh0=,r=b9z08gNFdFI/kA+Z24SXXNz9zFRgXCX2HUygzveHp7,p=abytUQ6Rrx3iitThZQ9SjgCgHwU=
address@hidden:~$ 

Cut'n'paste the client-final into the server, like this:

T2: 
Yz1jRDEwYkhNdGRXNXBjWFZsTEN4dnJoMD0scj1iOXowOGdORmRGSS9rQStaMjRTWFhOejl6RlJnWENYMkhVeWd6dmVIcDcscD1hYnl0VVE2UnJ4M2lpdFRoWlE5U2pnQ2dId1U9
T2: Enter password: 

Type the same password 'gsasl' and it will proceed:

T2: Output from server:
T2: dj1hL1lPZEJjem4vdVhPcEhPWmdPR2hMeVZOQXM9
T2: Server authentication finished (client trusted)...
T2: Enter application data (EOF to finish):

The server is now done!  It was a successful authentication.  You can
base64 decode the server-final like this:

address@hidden:~$ echo dj1hL1lPZEJjem4vdVhPcEhPWmdPR2hMeVZOQXM9|base64 -d; echo
v=a/YOdBczn/uXOpHOZgOGhLyVNAs=
address@hidden:~$ 

Paste this into the client, and let it finish too..

T1: dj1hL1lPZEJjem4vdVhPcEhPWmdPR2hMeVZOQXM9
T1: Output from client:
T1: 
T1: Client authentication finished (server trusted)...
T1: Enter application data (EOF to finish):

That's it!

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]