return STUN_VALIDATION_BAD_REQUEST;
}
/* Checks FINGERPRINT */
- crc32 = stun_fingerprint (msg->buffer, stun_message_length (msg),
- agent->compatibility == STUN_COMPATIBILITY_WLM2009);
+ crc32 = stun_fingerprint (msg->buffer, stun_message_length (msg), FALSE);
fpr = ntohl (fpr);
if (fpr != crc32) {
stun_debug ("STUN demux error: bad fingerprint: 0x%08x,"
return 0;
}
- fpr = stun_fingerprint (msg->buffer, stun_message_length (msg),
- agent->compatibility == STUN_COMPATIBILITY_WLM2009);
+ fpr = stun_fingerprint (msg->buffer, stun_message_length (msg), FALSE);
memcpy (ptr, &fpr, sizeof (fpr));
stun_debug_bytes (" Message HMAC-SHA1 fingerprint: ", ptr, 4);
* as defined by [MS-TURN]
* @STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER: The CANDIDATE-IDENTIFIER optional
* attribute as defined by [MS-ICE2]
+ * @STUN_ATTRIBUTE_MS_IMPLEMENTATION_VERSION: The IMPLEMENTATION-VERSION
+ * optional attribute as defined by [MS-ICE2]
*
* Known STUN attribute types as defined by various RFCs and drafts
*/
/* 0x802B-0x804F */ /* reserved */
STUN_ATTRIBUTE_MS_SEQUENCE_NUMBER=0x8050, /* MS-TURN */
/* 0x8051-0x8053 */ /* reserved */
- STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER=0x8054 /* MS-ICE2 */
- /* 0x8055-0xFFFF */ /* reserved */
+ STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER=0x8054, /* MS-ICE2 */
+ /* 0x8055-0x806F */ /* reserved */
+ STUN_ATTRIBUTE_MS_IMPLEMENTATION_VERSION=0x8070 /* MS-ICE2 */
+ /* 0x8071-0xFFFF */ /* reserved */
} StunAttribute;
if (val != STUN_MESSAGE_RETURN_SUCCESS)
return 0;
+
+ val = stun_message_append32 (msg,
+ STUN_ATTRIBUTE_MS_IMPLEMENTATION_VERSION, 2);
+
+ if (val != STUN_MESSAGE_RETURN_SUCCESS)
+ return 0;
}
return stun_agent_finish_message (agent, msg, password, password_len);
goto failure;
}
+ if (compatibility == STUN_USAGE_ICE_COMPATIBILITY_MSICE2) {
+ val = stun_message_append32 (msg,
+ STUN_ATTRIBUTE_MS_IMPLEMENTATION_VERSION, 2);
+ if (val != STUN_MESSAGE_RETURN_SUCCESS) {
+ stun_debug ("Error appending implementation version: %d", val);
+ goto failure;
+ }
+ }
/* the stun agent will automatically use the password of the request */
len = stun_agent_finish_message (agent, msg, NULL, 0);