On Wed, Mar 28, 2012 at 10:45 AM, David Sommerseth
<openvpn.l...@topphemmelig.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 26/03/12 23:26, Alon Bar-Lev wrote:
>> Signed-off-by: Alon Bar-Lev <alon.bar...@gmail.com> ---
>> src/openvpn/httpdigest.c |   44
>> ++++++++++++++++++++++---------------------- 1 files changed, 22
>> insertions(+), 22 deletions(-)
>>
>> diff --git a/src/openvpn/httpdigest.c b/src/openvpn/httpdigest.c index
>> 78b8344..a011e56 100644 --- a/src/openvpn/httpdigest.c +++
>> b/src/openvpn/httpdigest.c @@ -76,20 +76,20 @@ DigestCalcHA1( const
>> md_kt_t *md5_kt = md_kt_get("MD5");
>>
>> md_ctx_init(&md5_ctx, md5_kt); -  md_ctx_update(&md5_ctx, pszUserName,
>> strlen(pszUserName)); -  md_ctx_update(&md5_ctx, ":", 1); -
>> md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm)); -
>> md_ctx_update(&md5_ctx, ":", 1); -  md_ctx_update(&md5_ctx,
>> pszPassword, strlen(pszPassword)); +  md_ctx_update(&md5_ctx, (uint8_t
>> *)pszUserName, strlen(pszUserName)); +  md_ctx_update(&md5_ctx,
>> (uint8_t *)":", 1); +  md_ctx_update(&md5_ctx, (uint8_t *)pszRealm,
>> strlen(pszRealm)); +  md_ctx_update(&md5_ctx, (uint8_t *)":", 1); +
>> md_ctx_update(&md5_ctx, (uint8_t *)pszPassword, strlen(pszPassword));
>
> My remark here goes to all these type-cast patches [1,2,3].
>
> Wouldn't it be way cleaner to rather fix the function declarations and do
> the proper type-casting in the {crypto,ssl}_{open,polar}ssl.[ch] and
> {crypto,ssl}_backend.h files?  Instead of type-casting the whole source
> code where such warnings might pop up?

I fixed the smallest chunk I found using sun compiler...

Anyway, I think the use of uint8_t is misleading in this case, buffers
should be declared as (unsigned char *). If you agree to this
statement we need a larger change, I can do this as well.

Most of the code fixed is using standard C string (char *), so casting
will be necessary in either case.

Alon.

Reply via email to