[sr-dev] [kamailio/kamailio] uac: uacreg send incorrect hash response (#2108)

Vadim notifications at github.com
Tue Oct 22 16:58:23 CEST 2019


So there is a problem with the function "cvt_bin"

```
static inline void cvt_bin(HASHHEX hex, HASH bin)
{
        unsigned short i;
        unsigned char j;
        for (i = 0; i<HASHLEN; i++) {
                if(hex[2*i]>='0' && hex[2*i]<='9')
                        j = (hex[2*i]-'0') << 4;
                else if(hex[2*i]>='a'&&hex[2*i]<='f')
                        j = (hex[2*i]-'a'+10) << 4;
                else if(hex[2*i]>='A'&&hex[2*i]<='F')
                        j = (hex[2*i]-'A'+10) << 4;
                else j = 0;

                if(hex[2*i+1]>='0'&&hex[2*i+1]<='9')
                        j += hex[2*i+1]-'0';
                else if(hex[2*i+1]>='a'&&hex[2*i+1]<='f')
                        j += hex[2*i+1]-'a'+10;
                else if(hex[2*i+1]>='A'&&hex[2*i+1]<='F')
                        j += hex[2*i+1]-'A'+10;

                bin[i] = j;
        }
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2108#issuecomment-545004344
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191022/34e80667/attachment.html>


More information about the sr-dev mailing list