diff --git a/INSTALL b/INSTALL index 01cc478a..81d3a1d7 100644 --- a/INSTALL +++ b/INSTALL @@ -10,9 +10,7 @@ Linux: - gnutls (e.g. version 2.2.2) --> http://www.gnu.org/software/gnutls/ - libboost_thread, libboost_filesystem, libboost_datetime, libboost_program_options, libboost_iostreams, libboost_asio, libboost_regex - (version >= 1.36, 1.45.0 recommended) --> http://www.boost.org/ - NOTE: Please do not use boost 1.39.0 for the dedicated server, due to bug - https://svn.boost.org/trac/boost/ticket/3095 + (version >= 1.42, latest always recommended) --> http://www.boost.org/ - libSDL_mixer, libSDL --> http://www.libsdl.org/ - libSQLite >= 3.0 --> http://sqlite.org/ - libtinyxml > 2.0 --> http://www.sourceforge.net/projects/tinyxml diff --git a/docs/pokerth.asn1 b/docs/pokerth.asn1 index 695a1bcb..2d52fbc1 100644 --- a/docs/pokerth.asn1 +++ b/docs/pokerth.asn1 @@ -765,7 +765,7 @@ NonZeroId ::= INTEGER(1..4294967295) Id ::= INTEGER(0..4294967295) -Guid ::= INTEGER(0..4294967295) -- TODO +Guid ::= OCTET STRING (SIZE(16)) Card ::= INTEGER(0..51) diff --git a/src/third_party/asn1/Guid.c b/src/third_party/asn1/Guid.c index 40a567e3..65960954 100644 --- a/src/third_party/asn1/Guid.c +++ b/src/third_party/asn1/Guid.c @@ -10,7 +10,8 @@ int Guid_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; + const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; + size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -19,31 +20,38 @@ Guid_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; + size = st->size; - /* Constraint check succeeded */ - return 0; + if((size == 16)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } } /* - * This type is implemented using NativeInteger, + * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static void Guid_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_OCTET_STRING.free_struct; + td->print_struct = asn_DEF_OCTET_STRING.print_struct; + td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; + td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; + td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; + td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; + td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; + td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; + td->elements = asn_DEF_OCTET_STRING.elements; + td->elements_count = asn_DEF_OCTET_STRING.elements_count; + td->specifics = asn_DEF_OCTET_STRING.specifics; } void @@ -90,13 +98,8 @@ Guid_encode_xer(asn_TYPE_descriptor_t *td, void *structure, return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } -static asn_INTEGER_specifics_t asn_SPC_Guid_specs_1 = { - 0, 0, 0, 0, 0, - 0, /* Native long size */ - 1 /* Unsigned representation */ -}; static ber_tlv_tag_t asn_DEF_Guid_tags_1[] = { - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_Guid = { "Guid", @@ -118,6 +121,6 @@ asn_TYPE_descriptor_t asn_DEF_Guid = { /sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ - &asn_SPC_Guid_specs_1 /* Additional specs */ + 0 /* No specifics */ }; diff --git a/src/third_party/asn1/Guid.h b/src/third_party/asn1/Guid.h index a6d56f47..f3ad4422 100644 --- a/src/third_party/asn1/Guid.h +++ b/src/third_party/asn1/Guid.h @@ -12,14 +12,14 @@ #include /* Including external dependencies */ -#include +#include #ifdef __cplusplus extern "C" { #endif /* Guid */ -typedef unsigned long Guid_t; +typedef OCTET_STRING_t Guid_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_Guid; diff --git a/src/third_party/asn1/InitAckMessage.c b/src/third_party/asn1/InitAckMessage.c index dd5cbd0e..7db66ef3 100644 --- a/src/third_party/asn1/InitAckMessage.c +++ b/src/third_party/asn1/InitAckMessage.c @@ -9,7 +9,7 @@ static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = { { ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourSessionId), - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_Guid, 0, /* Defer constraints checking to the member type */ @@ -41,9 +41,9 @@ static ber_tlv_tag_t asn_DEF_InitAckMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_InitAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* yourSessionId at 144 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* yourPlayerId at 145 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 0 } /* yourAvatar at 146 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* yourPlayerId at 145 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* yourSessionId at 144 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, -1, 0 } /* yourAvatar at 146 */ }; static asn_SEQUENCE_specifics_t asn_SPC_InitAckMessage_specs_1 = { sizeof(struct InitAckMessage),