[OpenSIPS-Users] How to recalculate ha1 and ha1b

DangVinh Nguyen dangvinh.nguyen at gmail.com
Sat Jul 11 07:38:46 CEST 2009


 Hi Dioris

Thanks a lot for your tip.

When I calculated ha1 the first time,I missed the colon between fields. It
must be included in the hash.

Regards
DangVinh

On Fri, Jul 10, 2009 at 10:40 PM, Bogdan-Andrei Iancu <
bogdan at voice-system.ro> wrote:

> Hi Dioris,
>
> Could you upload this on the web site (TIPS section) for other people
> benefit ? See: http://www.opensips.org/Resources/Documentation#toc4
>
> If you create an account on the web site, you are free to edit the content.
>
> Thanks and regards,
> Bogdan
>
>
>
> Dioris Moreno wrote:
> > When you change the domain column in the subscriber table, you have to
> > recalculate ha1 and ha1b fields. In order to do that you must have the
> > password of each subscriber. It is stored in the 'password' column if
> > you have set STORE_PLAINTEXT_PW=1 in opensipsctlrc (default).
> >
> > HA1 is a MD5 hash of "username:domain:password". For example, if you
> > have created a SIP account 1000 at mydomain.com
> > <mailto:1000 at mydomain.com> using password 123456, then HA1 is the MD5
> > hash of "1000:mydomain.com:123456 <http://mydomain.com:123456>"
> > (without quotes). On the other hand HA1B is the MD5 hash of
> > "username at domain:domain:password"; so using the same example above,
> > HA1B would be the MD5 hash of "1000 at mydomain.com:mydomain.com:123456
> > <http://ydomain.com:123456>" (without quotes).
> >
> > So, to recalculate and update ha1 and ha1b columns in the subscriber
> > table, just execute the following sql statement in mysql:
> >
> > update subscriber
> > set ha1 = md5(concat(username, ':', domain, ':', password)),
> > ha1b = md5(concat(username, '@', domain, ':', domain, ':', password))
> >
> > I hope this could be useful.
> >
> > Regards,
> >
> > Dioris
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090711/a359b85a/attachment.htm 


More information about the Users mailing list