<div dir="ltr"><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr">Hey folks,</div><div dir="ltr"><br></div><div>I am making good progress on implementing RFC8760 (SHA-XXX for digest auth), basically the UAS side is functional and tested against our Sippy Python implementation*.  Trying to organize and clean the code as I go. Thanks to Liviu by the way for his help flushing some code cleanups and fixes!</div><div><br></div><div>The problem that I am hitting now is that we have digest computation code duplicated in both modules (auth vs. uac_auth), which of course is less than ideal from many perspectives (2x code to test, code bloat, pain to add more algorithms etc).</div><div><br></div><div>Now the question is what is the best way to deal with it. Couple of options I have:</div><div><br></div><div>1. Make uas_auth use code from the auth module and add it as a dependency. In general this seems to be the path the project takes to solve this problem. The downside is perhaps some small performance degradation as well some overhead to define and maintain API. Also this method does not work for smallish bits and pieces, too heavy-weight for an API.</div><div><br></div><div>2. Move code into the core. I think this is probably the wrong direction, some application might not need auth at all. 

Just listing it for completeness sake. 

</div><div><br></div><div>3. Move code into some kind of internal static library (say "libospcore.a") and link both modules against that library. I really like this approach since apart from some make-foo to get the library compiled and linked with each of modules, the rest is pretty much trivial. This avoids API/dependency overhead. With things like link-time-optimization becoming de-facto standard in the next 2-3 years would give the best possible performance with very small size overhead. Also works great for useful functions that are too small for an API (for example function to convert binary into hex and the likes). </div><div><br></div><div>Would love to hear what you guys think!</div><div><br></div><div>-Max</div><div>*) <a href="https://github.com/OpenSIPS/opensips/compare/master...sippy:RFC8760?expand=1">https://github.com/OpenSIPS/opensips/compare/master...sippy:RFC8760?expand=1</a></div></div></div>