[Devel] Re: uac_auth - set credentials with avpops - Patch

Thomas Gelf thomas at gelf.net
Sun Jan 29 00:39:05 CET 2006


Hi all,

last night and this afternoon I did my best to try to teach myself
some little pieces of C as I really want this feature (uac_auth &
avp) to be realized as soon as possible.

Don't ask me how many times I tried to compile OpenSER ;-) I had to
struggle a lot with this "str" and "int_str" structs, searched the
web for good docs/examples and did some kind of copy & paste
programming...

The result of my work is attached to this mail. The patch applies
to OpenSER 1.0.0 and compiles without warnings. I used to build
Debian packages but it should probably behave the same on other
systems too.

I added the following configuration directives to openser.cfg:

 > modparam("uac","username_avp", 101)
 > modparam("uac","password_avp", 102)
 > modparam("uac","realm_avp", 103)

And directly in front of my uac_auth() call I added:

 > avp_write("0123456789", "i:101");
 > avp_write("mypassword", "i:102");
 > avp_write("host.domain.tld", "i:103");

If I remove the username_avp modparam everything (including uac_auth
with static credentials) works well. My patch also removes the check
on QOP as my outbount SIP proxy adds qop to it's authentication
requests.

But if I add my username_avp param OpenSER dies:

 > ...
 > UAC:uac_auth: using username from avp: 0123456789
 > UAC:uac_auth: using password from avp
 > UAC:uac_auth: using realm from avp: host.domain.tld
 > child process 8777 exited by a signal 6
 > core was not generated
 > INFO: terminating due to SIGCHLD
 > INFO: signal 15 received
 > ...

Can anyone give me a on hint how to correctly copy values around? Or
what else did I wrong in my patch? C and all this *#$%&# strcpy, mem
allocations and str-structs are going to drive me cracy :-(

Best regards,
Thomas Gelf


Bogdan-Andrei Iancu schrieb:
> Hi Thomas,
> 
> there are two possible ways fo passing dynamic values for credentials 
> into uac_auth():
> 
> 1) is what you suggested, the simplest but not so efficient version: 
> internally the parameter have to be build from the three variables and 
> later the functions needs to parse to identify  each of them.
> 2) set as module parameters three AVP IDs -  usr_auth() will use the 
> configured AVPs as sources for additional user, domain and passwd. This 
> will be much faster in my opinion,
> 
> regards,
> bogdan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uac_auth_avp_v1.diff
Type: text/x-patch
Size: 5259 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20060129/b969234b/uac_auth_avp_v1.bin


More information about the Devel mailing list