+/* convert the hashed binary password to hexadecimal representation and
+ free the hashed binary password */
+void to_hexadecimal (char *hex, unsigned char *binary_pwd, unsigned int len)
+{
+ char buf[3];
+ /* keep reference to beginning of the hashed password */
+ unsigned char *binary_pw_begin = binary_pwd;
+ for (int i = 0; i < len; i ++)
+ {
+ sprintf (buf, "%02x", (*binary_pwd)&0xff);
+ strcat (hex, buf);
+ binary_pwd ++;
+ }
+ /* free the hashed password */
+ OPENSSL_free (binary_pw_begin);
+}
+