File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -444,18 +444,18 @@ SHA256_hexdigest(SHAobject *self, PyObject *unused)
444444 unsigned char digest [SHA_DIGESTSIZE ];
445445 SHAobject temp ;
446446 PyObject * retval ;
447- char * hex_digest ;
447+ Py_UNICODE * hex_digest ;
448448 int i , j ;
449449
450450 /* Get the raw (binary) digest value */
451451 SHAcopy (self , & temp );
452452 sha_final (digest , & temp );
453453
454454 /* Create a new string */
455- retval = PyString_FromStringAndSize (NULL , self -> digestsize * 2 );
455+ retval = PyUnicode_FromStringAndSize (NULL , self -> digestsize * 2 );
456456 if (!retval )
457457 return NULL ;
458- hex_digest = PyString_AsString (retval );
458+ hex_digest = PyUnicode_AS_UNICODE (retval );
459459 if (!hex_digest ) {
460460 Py_DECREF (retval );
461461 return NULL ;
Original file line number Diff line number Diff line change @@ -510,18 +510,18 @@ SHA512_hexdigest(SHAobject *self, PyObject *unused)
510510 unsigned char digest [SHA_DIGESTSIZE ];
511511 SHAobject temp ;
512512 PyObject * retval ;
513- char * hex_digest ;
513+ Py_UNICODE * hex_digest ;
514514 int i , j ;
515515
516516 /* Get the raw (binary) digest value */
517517 SHAcopy (self , & temp );
518518 sha512_final (digest , & temp );
519519
520520 /* Create a new string */
521- retval = PyString_FromStringAndSize (NULL , self -> digestsize * 2 );
521+ retval = PyUnicode_FromStringAndSize (NULL , self -> digestsize * 2 );
522522 if (!retval )
523523 return NULL ;
524- hex_digest = PyString_AsString (retval );
524+ hex_digest = PyUnicode_AS_UNICODE (retval );
525525 if (!hex_digest ) {
526526 Py_DECREF (retval );
527527 return NULL ;
You can’t perform that action at this time.
0 commit comments