From 2a0e2bd242f7dc7cda4ee096e58f42d13db9803f Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 17 May 2007 18:27:25 +0000 Subject: [PATCH] Fix hashing when using RFC4711 --- libs/srtp/srtp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/srtp/srtp.c b/libs/srtp/srtp.c index ec303da83a..60c07b6f72 100644 --- a/libs/srtp/srtp.c +++ b/libs/srtp/srtp.c @@ -651,7 +651,16 @@ srtp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp) rcc = roc; const uint8_t *tag = rtp_digest (s, buf, len, rcc); - if (memcmp (buf + len + roc_len, tag, s->tag_len)) +#if 0 + printf ("Computed: 0x"); + for (unsigned i = 0; i < tag_len; i++) + printf ("%02x", tag[i]); + printf ("\nReceived: 0x"); + for (unsigned i = 0; i < tag_len; i++) + printf ("%02x", buf[len + roc_len + i]); + puts (""); +#endif + if (memcmp (buf + len + roc_len, tag, tag_len)) return EACCES; if (roc_len) -- 2.39.2