crypto: fix compiler warnings in the .c files

This commit is contained in:
Brian Warner 2007-08-15 17:48:52 -07:00
parent 6c24848797
commit 664a0e6af4
3 changed files with 6 additions and 6 deletions

View File

@ -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"

View File

@ -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)
{

View File

@ -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++)