These are chat archives for IndySockets/Indy

26th
Sep 2018
olegskok
@olegskok
Sep 26 2018 08:08
Hi to everyone! is anybody have a sample, how to do DIGEST-MD5(XMPP) using Indy 10.6 (TIdEncoderMIME, TIdHashMessageDigest5)?
Remy Lebeau
@rlebeau
Sep 26 2018 16:12
@olegskok DIGEST-MD5 is a SASL (and an obsolete one at that). Indy has a TIdSASLDigest component for handling DIGEST-MD5 in SASL-enabled components (TIdPOP3, TIdSMTP, TIdIMAP4, and TIdDICT). TIdSASLDigest doesn't handle the base64 portion, as that is part of the transmission protocol, not the SASL itself, so you will still need to use TId(Encoder|Decoder)MIME yourself. But, you can receive the XMPP server's <challenge>, base64 decode it with TIdDecoderMIME.DecodeString() and pass the data to TIdSASLDigest.StartAuthenticate() to get an answer, then base64 encode with TIdEncoderMIME.EncodeString() and send it in a <response>. For each subsequent <challenge> from the server, base64 decode and pass its data to TIdSASLDigest.ContinueAuthenticate(), and base64 encode and send a <response>, until the server returns a final <response> on failue or <success> on success. See https://wiki.xmpp.org/web/SASLandDIGEST-MD5 for more details.