mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
crypto: fix compiler warnings in the .c files
This commit is contained in:
parent
6c24848797
commit
664a0e6af4
@ -194,7 +194,7 @@ hash_digest (const hash_state *self)
|
||||
|
||||
hash_copy((hash_state*)self,&temp);
|
||||
sha_done(&temp,digest);
|
||||
return PyString_FromStringAndSize(digest, 32);
|
||||
return PyString_FromStringAndSize((char *)digest, 32);
|
||||
}
|
||||
|
||||
#include "hash_template.c"
|
||||
|
@ -410,7 +410,7 @@ ALG_Encrypt(ALGobject *self, PyObject *args)
|
||||
free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
result=PyString_FromStringAndSize(buffer, len);
|
||||
result=PyString_FromStringAndSize((char *)buffer, len);
|
||||
free(buffer);
|
||||
return(result);
|
||||
}
|
||||
@ -572,7 +572,7 @@ ALG_Decrypt(ALGobject *self, PyObject *args)
|
||||
free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
result=PyString_FromStringAndSize(buffer, len);
|
||||
result=PyString_FromStringAndSize((char *)buffer, len);
|
||||
free(buffer);
|
||||
return(result);
|
||||
}
|
||||
@ -674,7 +674,7 @@ ALGgetattr(PyObject *s, char *name)
|
||||
ALGobject *self = (ALGobject*)s;
|
||||
if (strcmp(name, "IV") == 0)
|
||||
{
|
||||
return(PyString_FromStringAndSize(self->IV, BLOCK_SIZE));
|
||||
return(PyString_FromStringAndSize((char *)(self->IV), BLOCK_SIZE));
|
||||
}
|
||||
if (strcmp(name, "mode") == 0)
|
||||
{
|
||||
|
@ -105,11 +105,11 @@ ALG_hexdigest(ALGobject *self, PyObject *args)
|
||||
/* Get the raw (binary) digest value */
|
||||
value = (PyObject *)hash_digest(&(self->st));
|
||||
size = PyString_Size(value);
|
||||
raw_digest = PyString_AsString(value);
|
||||
raw_digest = (unsigned char *)PyString_AsString(value);
|
||||
|
||||
/* Create a new string */
|
||||
retval = PyString_FromStringAndSize(NULL, size * 2 );
|
||||
hex_digest = PyString_AsString(retval);
|
||||
hex_digest = (unsigned char *)PyString_AsString(retval);
|
||||
|
||||
/* Make hex version of the digest */
|
||||
for(i=j=0; i<size; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user