- 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);
+
+ EVP_EncodeBlock ((unsigned char*)encoded,
+ (const unsigned char*)binary_data, len);
+ OPENSSL_free (binary_data);