From 0c77e51de8f78a7e50e443ee8a1890a6a2834a67 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Tue, 20 Jul 2010 15:10:16 +0000 Subject: [Development] Use U32 as internal SecurityType type. Signed-off-by: Martin Koegler git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4097 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/Security.h | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'common/rfb/Security.h') diff --git a/common/rfb/Security.h b/common/rfb/Security.h index 19019353..54cdb80e 100644 --- a/common/rfb/Security.h +++ b/common/rfb/Security.h @@ -67,22 +67,32 @@ namespace rfb { */ Security(void); + /* + * Note about security types. + * + * Although RFB protocol specifies security types as U8 values, + * we map VeNCrypt subtypes (U32) into the standard security types + * to simplify user configuration. With this mapping user can configure + * both VeNCrypt subtypes and security types with only one option. + */ + /* Enable/Disable certain security type */ - void EnableSecType(rdr::U8 secType); - void DisableSecType(rdr::U8 secType) { enabledSecTypes.remove(secType); } + void EnableSecType(rdr::U32 secType); + void DisableSecType(rdr::U32 secType) { enabledSecTypes.remove(secType); } /* Check if certain type is supported */ - bool IsSupported(rdr::U8 secType); + bool IsSupported(rdr::U32 secType); - /* Get list of enabled security types */ - const std::list& GetEnabledSecTypes(void) - { return enabledSecTypes; } + /* Get list of enabled security types without VeNCrypt subtypes */ + const std::list GetEnabledSecTypes(void); + /* Get list of enabled VeNCrypt subtypes */ + const std::list GetEnabledExtSecTypes(void); /* Create server side SSecurity class instance */ - SSecurity* GetSSecurity(rdr::U8 secType); + SSecurity* GetSSecurity(rdr::U32 secType); /* Create client side CSecurity class instance */ - CSecurity* GetCSecurity(rdr::U8 secType); + CSecurity* GetCSecurity(rdr::U32 secType); static StringParameter secTypes; @@ -91,12 +101,12 @@ namespace rfb { * only in viewer-side code and MUST be set by viewer. */ private: - std::list enabledSecTypes; + std::list enabledSecTypes; }; - const char* secTypeName(rdr::U8 num); - rdr::U8 secTypeNum(const char* name); - std::list parseSecTypes(const char* types); + const char* secTypeName(rdr::U32 num); + rdr::U32 secTypeNum(const char* name); + std::list parseSecTypes(const char* types); } #endif -- cgit v1.2.3