-/* hash a text
- * * provided as a buffer (\0 terminated)
- * * with "\r\n" line endings if it's a text signature, else use UNIX line
- * * endings
- */
-static int hash_from_string( const char *psz_string, gcry_md_hd_t hd,
- bool text_signature )
-{
- while( *psz_string )
- {
- size_t i_len = strcspn( psz_string, "\r\n" );
- if( !i_len )
- break;
-
- gcry_md_write( hd, psz_string, i_len );
- if( text_signature )
- gcry_md_putc( hd, '\r' );
- gcry_md_putc( hd, '\n' );
-
- psz_string += i_len;
- while( *psz_string == '\r' || *psz_string == '\n' )
- psz_string++;
- }
-
- return 0;
-}
-
-