[sr-dev] git:master: pv: added SHA string transformations

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 14 23:34:16 CET 2014


Hi Lucian,

look also at the following warning reported by llvm.

Thanks,
Daniel

sha256.c:627:31: warning: 'memset' call operates on objects of type 
'SHA256_CTX' (aka 'struct _SHA256_CTX') while the size is based on a 
different type 'SHA256_CTX *'
       (aka 'struct _SHA256_CTX *') [-Wsizeof-pointer-memaccess]
         MEMSET_BZERO(context, sizeof(context));
                      ~~~~~~~         ^~~~~~~
sha256.c:627:31: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
         MEMSET_BZERO(context, sizeof(context));
                                      ^~~~~~~
sha256.c:648:32: warning: 'memset' call operates on objects of type 
'SHA256_CTX' (aka 'struct _SHA256_CTX') while the size is based on a 
different type 'SHA256_CTX *'
       (aka 'struct _SHA256_CTX *') [-Wsizeof-pointer-memaccess]
                 MEMSET_BZERO(context, sizeof(context));
                              ~~~~~~~         ^~~~~~~
sha256.c:648:32: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
                 MEMSET_BZERO(context, sizeof(context));
                                              ^~~~~~~
sha256.c:957:31: warning: 'memset' call operates on objects of type 
'SHA512_CTX' (aka 'struct _SHA512_CTX') while the size is based on a 
different type 'SHA512_CTX *'
       (aka 'struct _SHA512_CTX *') [-Wsizeof-pointer-memaccess]
         MEMSET_BZERO(context, sizeof(context));
                      ~~~~~~~         ^~~~~~~
sha256.c:957:31: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
         MEMSET_BZERO(context, sizeof(context));
                                      ^~~~~~~
sha256.c:977:32: warning: 'memset' call operates on objects of type 
'SHA512_CTX' (aka 'struct _SHA512_CTX') while the size is based on a 
different type 'SHA512_CTX *'
       (aka 'struct _SHA512_CTX *') [-Wsizeof-pointer-memaccess]
                 MEMSET_BZERO(context, sizeof(context));
                              ~~~~~~~         ^~~~~~~
sha256.c:977:32: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
                 MEMSET_BZERO(context, sizeof(context));
                                              ^~~~~~~
sha256.c:1032:31: warning: 'memset' call operates on objects of type 
'SHA384_CTX' (aka 'struct _SHA512_CTX') while the size is based on a 
different type 'SHA384_CTX *'
       (aka 'struct _SHA512_CTX *') [-Wsizeof-pointer-memaccess]
         MEMSET_BZERO(context, sizeof(context));
                      ~~~~~~~         ^~~~~~~
sha256.c:1032:31: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
         MEMSET_BZERO(context, sizeof(context));
                                      ^~~~~~~
sha256.c:1052:32: warning: 'memset' call operates on objects of type 
'SHA384_CTX' (aka 'struct _SHA512_CTX') while the size is based on a 
different type 'SHA384_CTX *'
       (aka 'struct _SHA512_CTX *') [-Wsizeof-pointer-memaccess]
                 MEMSET_BZERO(context, sizeof(context));
                              ~~~~~~~         ^~~~~~~
sha256.c:1052:32: note: did you mean to dereference the argument to 
'sizeof' (and multiply it by the number of elements)?
                 MEMSET_BZERO(context, sizeof(context));
                                              ^~~~~~~


On 14/03/14 14:10, Lucian Balaceanu wrote:
> Hi Daniel,
>
> I will move the sha256.c/h to the lib/srutils/ and then recommit.
>
> Thank you,
> Lucian
>
> On 03/14/2014 02:15 PM, Daniel-Constantin Mierla wrote:
>> Hi Lucian,
>>
>> for clarification, are the new files (sha*) under BSD license? Looks 
>> like, but wanted to double check if you looked at author's source.
>>
>> I would suggest to move them to lib/srutils/ because they are needed 
>> only from one module, so we keep the core smaller.
>>
>> Cheers,
>> Daniel
>>
>> On 14/03/14 11:20, Lucian Balaceanu wrote:
>>> Module: sip-router
>>> Branch: master
>>> Commit: 2f4877a9e3e104a90b03fcb380899848d3643997
>>> URL: 
>>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2f4877a9e3e104a90b03fcb380899848d3643997
>>>
>>> Author: Irina Grigorescu <irina.grigorescu at 1and1.ro>
>>> Committer: lucian balanceanu <lucian.balanceanu at 1and1.ro>
>>> Date:   Fri Mar 14 12:17:39 2014 +0200
>>>
>>> pv: added SHA string transformations
>>>
>>> - added sha256, sha384 and sha512 string transformations to return sha
>>>    over PV value
>>>
>>> ---
>>>
>>>   lib/kcore/strcommon.c |   33 ++
>>>   lib/kcore/strcommon.h |    7 +
>>>   modules/pv/pv_trans.c |   40 ++
>>>   modules/pv/pv_trans.h |    4 +-
>>>   sha256.c              | 1064 
>>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>>   sha256.h              |  196 +++++++++
>>>   sha2utils.h           |   17 +
>>>   7 files changed, 1359 insertions(+), 2 deletions(-)
>>>
>>> Diff: 
>>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=2f4877a9e3e104a90b03fcb380899848d3643997
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>
>

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
http://www.kamailioworld.com




More information about the sr-dev mailing list