Skip to contentSkip to conversation

PATCH: Secure TLS encrypted authentication for VNC

Qemu-devel Peter Rosin 3 participants 5 messages Jun 3, 2008

lore
Share & tools
lore
#0 lore raw

Hi!

Sorry for the response to this old post, but since it seems to be the best reference for the VeNCrypt protocol on the web, I don't feel too bad. Hopefully I got the message-id correct so that this post is properly linked.

S. I. Becker skrev:

Quoted 3 lines
Quoted 2 lines · Daniel P. Berrange

If there's any formal doc describing the VeNCrypt auth system in the same style as the primary RFB protocol doc[1] that'd be very helpful.

*snip*

Quoted 7 lines

Dan,

The closest I have to a formal spec are some emails going back-and-forth between Martin Koegler and myself over what the protocol should be. I've tried to collate and format these together below. Please let me know if anything is not clear, or if you can spot any edge-cases that permit security flaws.

*snip*

Quoted 11 lines

RFB Protocol Section 6.2.19.257 - TLSNone VeNCrypt sub-type

If the TLSNone, TLSVnc or TLSPlain sub-types have been chosen, Anonymous TLS authentication is initiated as described in the TLS protocol.

If the TLS authentication was not successful, the connection is closed.
Otherwise, all further communication takes place over the encrypted
TLS channel.

If the TLSNone sub-type was chosen, authentication continues as for the None type described in section 6.2.1.

*snip*

I would like to point out that vencserver seems to be sending an extra U8 (== 0x01. Is that a boolean? 0x00 means failure?) before the SSL/TLS handshake is started. The QEMU implementation does this also, so the bug is clearly in this "spec". This also affects sub-types 258, 259, 260, 261 and 262.

Cheers,
Peter (not subscribed)

#1 lore raw
Quoted 7 lines · Peter Rosin

Hi!

Sorry for the response to this old post, but since it seems to be the best reference for the VeNCrypt protocol on the web, I don't feel too bad. Hopefully I got the message-id correct so that this post is properly linked.

<snip>

Quoted 9 lines

I would like to point out that vencserver seems to be sending an extra U8 (== 0x01. Is that a boolean? 0x00 means failure?) before the SSL/TLS handshake is started. The QEMU implementation does this also, so the bug is clearly in this "spec". This also affects sub-types 258, 259, 260, 261 and 262.

Cheers,
Peter (not subscribed)

Peter,

It's been a while since I looked at it, and don't have time immediately to check it in detail, but I think that this is the SecurityResult message as detailed in section 6.1.3 of the RFB specification. Re-reading it, I could probably have been more clear in my mail to Dan about where the VenCrypt extension rejoins the RFB protocol. The reason that I put this in the extension code instead of the "main" VNC code is that only the extension knows whether the success of failure message should be sent.

Yours,

Stewart

#2 lore raw
Quoted 17 lines · Stewart Becker
Quoted 7 lines · Peter Rosin

Hi!

Sorry for the response to this old post, but since it seems to be the best reference for the VeNCrypt protocol on the web, I don't feel too bad. Hopefully I got the message-id correct so that this post is properly linked.

<snip>

Quoted 5 lines

I would like to point out that vencserver seems to be sending an extra U8 (== 0x01. Is that a boolean? 0x00 means failure?) before the SSL/TLS handshake is started. The QEMU implementation does this also, so the bug is clearly in this "spec". This also affects sub-types 258, 259, 260, 261 and 262.

Quoted 8 lines

It's been a while since I looked at it, and don't have time immediately to check it in detail, but I think that this is the SecurityResult message as detailed in section 6.1.3 of the RFB specification. Re-reading it, I could probably have been more clear in my mail to Dan about where the VenCrypt extension rejoins the RFB protocol. The reason that I put this in the extension code instead of the "main" VNC code is that only the extension knows whether the success of failure message should be sent.

When I wrote the code I checked the interoperability of QEMU against the VeNCrypt client, and the GTK-VNC client agains the VeNCrypt server and QEMU server, so the impl is the defacto spec :-)

Regards,
Daniel

Signature · 4 lines
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
#3 lore raw
In reply to Stewart Becker

Stewart Becker skrev:

Quoted 23 lines · Peter Rosin
Quoted 7 lines

Hi!

Sorry for the response to this old post, but since it seems to be the best reference for the VeNCrypt protocol on the web, I don't feel too bad. Hopefully I got the message-id correct so that this post is properly linked.

<snip>

Quoted 9 lines

I would like to point out that vencserver seems to be sending an extra U8 (== 0x01. Is that a boolean? 0x00 means failure?) before the SSL/TLS handshake is started. The QEMU implementation does this also, so the bug is clearly in this "spec". This also affects sub-types 258, 259, 260, 261 and 262.

Cheers,
Peter (not subscribed)

Peter,

Quoted 8 lines

It's been a while since I looked at it, and don't have time immediately to check it in detail, but I think that this is the SecurityResult message as detailed in section 6.1.3 of the RFB specification. Re-reading it, I could probably have been more clear in my mail to Dan about where the VenCrypt extension rejoins the RFB protocol. The reason that I put this in the extension code instead of the "main" VNC code is that only the extension knows whether the success of failure message should be sent.

I don't think it's the security result, because the security result comes after the TLS handshake. This is apparent if you consider the variants based on Vnc-Auth and Plain where the security result comes after the authentication and the authentication is clearly inside the encrypted tunnel. But the security result comes inside the TLS tunnel for the variants based on None as well, that's a fact. Another piece of evidence that it is not the security result is the fact that the security result is U32 and this "missing element" is a U8. Pretty strong hint in my book :-)

Cheers,
Peter

#4 lore raw
Quoted 33 lines · Peter Rosin

Stewart Becker skrev:

Quoted 23 lines · Peter Rosin
Quoted 7 lines

Hi!

Sorry for the response to this old post, but since it seems to be the best reference for the VeNCrypt protocol on the web, I don't feel too bad. Hopefully I got the message-id correct so that this post is properly linked.

<snip>

Quoted 9 lines

I would like to point out that vencserver seems to be sending an extra U8 (== 0x01. Is that a boolean? 0x00 means failure?) before the SSL/TLS handshake is started. The QEMU implementation does this also, so the bug is clearly in this "spec". This also affects sub-types 258, 259, 260, 261 and 262.

Cheers,
Peter (not subscribed)

Peter,

Quoted 8 lines

It's been a while since I looked at it, and don't have time immediately to check it in detail, but I think that this is the SecurityResult message as detailed in section 6.1.3 of the RFB specification. Re-reading it, I could probably have been more clear in my mail to Dan about where the VenCrypt extension rejoins the RFB protocol. The reason that I put this in the extension code instead of the "main" VNC code is that only the extension knows whether the success of failure message should be sent.

Quoted 9 lines

I don't think it's the security result, because the security result comes after the TLS handshake. This is apparent if you consider the variants based on Vnc-Auth and Plain where the security result comes after the authentication and the authentication is clearly inside the encrypted tunnel. But the security result comes inside the TLS tunnel for the variants based on None as well, that's a fact. Another piece of evidence that it is not the security result is the fact that the security result is U32 and this "missing element" is a U8. Pretty strong hint in my book :-)

It is not *the* security result, rather it is an intermediate result. Basically the client has chosen to do VeNCrypt auth and has sent its request for the particular VeNCrypt sub-type it wants to use. This U8 is basically a boolean indication of whether the server accepts the clients choice of sub-type. If it accepts it, then the TLS handshake will proceed, the sub-type specific auth process takes place and you'll eventually get the final security result. If the server rejected the choice of sub-type, then it will be closing the connection anyway. So this u8 doesn't technically add any security to the protocol - it could have been left out and things would have worked just as well.

Regards,
Daniel.

Signature · 4 lines
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|