[asterisk-dev] [Code Review] update SHA1 code to RFC6234
Tzafrir Cohen
reviewboard at asterisk.org
Mon Oct 10 12:25:47 CDT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1503/
-----------------------------------------------------------
Review request for Asterisk Developers.
Summary
-------
Recently Sam Geeraerts filed a bug with the Debian package of Asterisk regarding the license of main/sha1.c . It seems that the license of that file, as is the license of many older RFCs, does not allow modifications to the source file (except for some very specific purposes). This is a violation of the Debian Free Software Guidelines and cannot be allowed in Debian.
Luckily, RFC 3174 (from which the existing code was taken) has been replaced by the recent RFC 6234. The latter comes with a simpler license (a BSD one) and a somewhat better code. This patch updates main/sha1.c and includes/asterisk/sha1.h usinf files from that RFC:
* sha.h and sha-private.h were merged into sha1.h
* Coding guildelines fixes (in sha1.c, mostly)
* Removed an unused include of sha1.h from main/channels.c .
The code is not very different. Some functions were statified. Some magic numbers were made constants. A few more unrequired headers (for sha256.c and co.), but almost no real code changes.
sha1.c has remained basically the same for quite some time, and thus this patch can be applied as-is on top of older branches, should it be useful to anybody. Alternatively: just copy the resulting source file after the commit.
Diffs
-----
/trunk/include/asterisk/sha1.h 340161
/trunk/main/channel.c 340161
/trunk/main/sha1.c 340161
Diff: https://reviewboard.asterisk.org/r/1503/diff
Testing
-------
Basic testing of function SHA1.
Thanks,
Tzafrir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111010/491d9568/attachment.htm>
More information about the asterisk-dev
mailing list