@@ -357,13 +357,17 @@ static char* _generate_date_string(void) {
357357 return date_string ;
358358}
359359
360- static char * _net_compute_signature (const ds3_creds * creds , http_verb verb , char * resource_name ,
360+ static char * _net_compute_signature (const ds3_log * log , const ds3_creds * creds , http_verb verb , char * resource_name ,
361361 char * date , char * content_type , char * md5 , char * amz_headers ) {
362362 GHmac * hmac ;
363363 gchar * signature ;
364364 gsize bufSize = 256 ;
365365 guint8 buffer [256 ];
366366 unsigned char * signature_str = _generate_signature_str (verb , resource_name , date , content_type , md5 , amz_headers );
367+ unsigned char * escaped_str = g_strescape (signature_str , NULL );
368+
369+ LOG (log , DEBUG , "signature string: %s" , escaped_str );
370+ g_free (escaped_str );
367371
368372 hmac = g_hmac_new (G_CHECKSUM_SHA1 , (unsigned char * ) creds -> secret_key -> value , creds -> secret_key -> size );
369373 g_hmac_update (hmac , signature_str , -1 );
@@ -571,7 +575,7 @@ static ds3_error* _net_process_request(const ds3_client* client, const ds3_reque
571575
572576 date = _generate_date_string ();
573577 date_header = g_strconcat ("Date: " , date , NULL );
574- signature = _net_compute_signature (client -> creds , request -> verb , request -> path -> value , date , "" , "" , "" );
578+ signature = _net_compute_signature (client -> log , client -> creds , request -> verb , request -> path -> value , date , "" , "" , "" );
575579 headers = NULL ;
576580 auth_header = g_strconcat ("Authorization: AWS " , client -> creds -> access_id -> value , ":" , signature , NULL );
577581
0 commit comments