diff options
author | Adam Tkac <atkac@redhat.com> | 2010-04-23 13:59:52 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2010-04-23 13:59:52 +0000 |
commit | 94d88c1799d6446c132a2ac7198601487d792099 (patch) | |
tree | a875eb50a160f77ffcbc2b27f3dd2b743368a2c5 /common | |
parent | 5a0caed91c3879413b23d6906341856d1cc31dc1 (diff) | |
download | tigervnc-94d88c1799d6446c132a2ac7198601487d792099.tar.gz tigervnc-94d88c1799d6446c132a2ac7198601487d792099.zip |
[Development] Define security types as rdr::U8 values.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4034 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/SSecurityFactoryStandard.cxx | 4 | ||||
-rw-r--r-- | common/rfb/Security.cxx | 12 | ||||
-rw-r--r-- | common/rfb/Security.h | 35 |
3 files changed, 26 insertions, 25 deletions
diff --git a/common/rfb/SSecurityFactoryStandard.cxx b/common/rfb/SSecurityFactoryStandard.cxx index 01f77bfc..6056a19e 100644 --- a/common/rfb/SSecurityFactoryStandard.cxx +++ b/common/rfb/SSecurityFactoryStandard.cxx @@ -65,8 +65,8 @@ void SSecurityFactoryStandard::getSecTypes(std::list<rdr::U8>* secTypes, bool re secTypesStr.buf = rev_sec_types.getData(); else secTypesStr.buf = sec_types.getData(); - std::list<int> configured = parseSecTypes(secTypesStr.buf); - std::list<int>::iterator i; + std::list<rdr::U8> configured = parseSecTypes(secTypesStr.buf); + std::list<rdr::U8>::iterator i; for (i=configured.begin(); i!=configured.end(); i++) { if (isSecTypeSupported(*i)) secTypes->push_back(*i); diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx index 830d8444..67acf5c9 100644 --- a/common/rfb/Security.cxx +++ b/common/rfb/Security.cxx @@ -22,7 +22,7 @@ #include <rfb/secTypes.h> #include <rfb/util.h> -int rfb::secTypeNum(const char* name) +rdr::U8 rfb::secTypeNum(const char* name) { if (strcasecmp(name, "None") == 0) return secTypeNone; if (strcasecmp(name, "VncAuth") == 0) return secTypeVncAuth; @@ -34,7 +34,7 @@ int rfb::secTypeNum(const char* name) return secTypeInvalid; } -const char* rfb::secTypeName(int num) +const char* rfb::secTypeName(rdr::U8 num) { switch (num) { case secTypeNone: return "None"; @@ -48,7 +48,7 @@ const char* rfb::secTypeName(int num) } } -bool rfb::secTypeEncrypts(int num) +bool rfb::secTypeEncrypts(rdr::U8 num) { switch (num) { case secTypeRA2: @@ -59,13 +59,13 @@ bool rfb::secTypeEncrypts(int num) } } -std::list<int> rfb::parseSecTypes(const char* types_) +std::list<rdr::U8> rfb::parseSecTypes(const char* types_) { - std::list<int> result; + std::list<rdr::U8> result; CharArray types(strDup(types_)), type; while (types.buf) { strSplit(types.buf, ',', &type.buf, &types.buf); - int typeNum = secTypeNum(type.buf); + rdr::U8 typeNum = secTypeNum(type.buf); if (typeNum != secTypeInvalid) result.push_back(typeNum); } diff --git a/common/rfb/Security.h b/common/rfb/Security.h index 3cf783bd..d890d560 100644 --- a/common/rfb/Security.h +++ b/common/rfb/Security.h @@ -22,33 +22,34 @@ #ifndef __RFB_SECTYPES_H__ #define __RFB_SECTYPES_H__ +#include <rdr/types.h> #include <list> namespace rfb { - const int secTypeInvalid = 0; - const int secTypeNone = 1; - const int secTypeVncAuth = 2; + const rdr::U8 secTypeInvalid = 0; + const rdr::U8 secTypeNone = 1; + const rdr::U8 secTypeVncAuth = 2; - const int secTypeRA2 = 5; - const int secTypeRA2ne = 6; + const rdr::U8 secTypeRA2 = 5; + const rdr::U8 secTypeRA2ne = 6; - const int secTypeSSPI = 7; - const int secTypeSSPIne = 8; + const rdr::U8 secTypeSSPI = 7; + const rdr::U8 secTypeSSPIne = 8; - const int secTypeTight = 16; - const int secTypeUltra = 17; - const int secTypeTLS = 18; + const rdr::U8 secTypeTight = 16; + const rdr::U8 secTypeUltra = 17; + const rdr::U8 secTypeTLS = 18; // result types - const int secResultOK = 0; - const int secResultFailed = 1; - const int secResultTooMany = 2; // deprecated + const rdr::U32 secResultOK = 0; + const rdr::U32 secResultFailed = 1; + const rdr::U32 secResultTooMany = 2; // deprecated - const char* secTypeName(int num); - int secTypeNum(const char* name); - bool secTypeEncrypts(int num); - std::list<int> parseSecTypes(const char* types); + const char* secTypeName(rdr::U8 num); + rdr::U8 secTypeNum(const char* name); + bool secTypeEncrypts(rdr::U8 num); + std::list<rdr::U8> parseSecTypes(const char* types); } #endif |