[Serusers] Newbie : SER and sipsak

Nils Ohlmeier lists at ohlmeier.org
Fri Jan 14 00:03:18 CET 2005


Hi Dragos,

thanks for you detailed report.
Meanwhile someone else pointed out the strcasestr function to me. I allready 
changed the code in the repository to use the case-in-sensitive alternative 
if it is available on the system. So that should hopefully not become a 
problem any more.
I hope strcasestr is faster then using regexec, allthough I do not have any 
numbers about that.

Unfortunately I have no clue why the password fails. Maybe you can send me the 
command line which you used to execute sipsak.

Thanks and regards
  Nils

On Tuesday 11 January 2005 03:07, Dragos CHIRIAC wrote:
> Hello,
>
> The three hours are over, and I had to redo the job. Sorry for not
> answering so late, but i wanted to thank you.
> I came to the same problem again. I modified the code to verify "Digest" to
> "DIGEST"
>
> It passed the problem after changing the line like
> if ((begin=strstr(auth, "DIGEST"))==NULL) {
>
> but it started to error like :
>
> error: authorization failed
> request already contains (Proxy-) Authorization, but received 40[1|7], see
> above
>
> I had to manually modify the code like:
>
> /*              if (!password) */
>                         password = "VS56sNZxs";
>
> At the beginning of the MD5 hashing to bypass the problem. (I hadcoded the
> password. The password looks like the one i gave you, with some undisclosed
> modifications, it is not my proxy after all)
> Now it works. ????
>  I do not have to time to see why after changing that i have to hardcode
> the password,  it just works like this and I integrated with nagios, I am
> very pleased that i solved the damn problem after all.
>
>
> About Case sensitive/insensitive
> As far as I know there is a implementation of POSIX.2 regular expressions
> in the glibc 3.+. And another older implementation that glibc have had for
> many years.
>
> Code should like (with posix regex-es):
>
> #include <regex.h> << this is the library
>
> ......
> const char *regex="(([D][I][G][E][S][T]))";
>
>  if (firsttime) {
>     if ( regcomp(&r,regex,REG_EXTENDED|REG_ICASE) ) { << here is the
> I(gnore)CASE Flag
>       fprintf(stderr,"Error compiling regular expression for parsing\n");
>       exit(1);
>     }
>     firsttime=0;
> }
>
> if (regexec(&r,message,10,pm,REG_NOTBOL)!=0) {
>   return(NULL);
> }
>
> Something like that should match even dIgeSt :).
> I am not a C programmer (not even a programmer), and this code is out of my
> stomach, and a copypaste from google.
> Maybe you will put regexes on all other matches. Mostly i saw that you use
> strstr to check the existence of a string. Regexes can do more. I do not
> guarantee that the code works (i can actually bet that it won't), but is an
> idea that it can be done. Some googleing should do the job ;). I bet it can
> be done easier.
> I am not very good at programming as i said, but maybe it helps. If i was
> good at it I would modify it myself, but I am very busy and I do not have
> the time to properly learn C or another language.
>
> (If you use regexes I wolud greatly enjoy my name at the thanks section,
> maybe i get a raise :P ... i would really need it)
>
> Thank you again for your software and your support.
> I wish you a happy new year and good archevements in the following year.
> And I am sorry for answering so late. But later is better than never.
>
> Dragos Chiriac
> dragos at pattco.ro
>
>
> ---------------
> Hello Dragos,
>
> I guess it is too late, the three hours are over, but you should read the
> sipsak homepage: please contact me directly with questions about sipsak,
> because I do not have the time any more to read the iptel mailing lists all
> over (not to think about real time).
>
> I do not understand your first problem report. If you resend the output of
> sipsak with -vvv I will take a look at output. BTW -f does not help you
> because with that parameter you can only load a SIP request from the given
> file, no options.
>
> The 401 from below has simply the problem that the word 'Digest' is in
> capital
> letters and sipsak searches only for Digest with the first character as
> capital. Unfortunately this is not easy to fix, as there are no
> case-insensitive string search methods in glibc available (AFAIK).
>
> Greetings
>   Nils
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list