2626 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727 * SUCH DAMAGE.
2828 *
29- * $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.28 2006/07/13 04:15:25 neilc Exp $
29+ * $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.29 2006/09/05 23:02:28 tgl Exp $
3030 */
3131
3232#include "postgres.h"
@@ -154,11 +154,12 @@ static int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *res, unsigned int
154154#include "sha2.c"
155155#include "internal-sha2.c"
156156
157- typedef int (* init_f )(PX_MD * md );
157+ typedef void (* init_f )(PX_MD * md );
158158
159159static int compat_find_digest (const char * name ,PX_MD * * res )
160160{
161161init_f init = NULL ;
162+
162163if (pg_strcasecmp (name ,"sha224" )== 0 )
163164init = init_sha224 ;
164165else if (pg_strcasecmp (name ,"sha256" )== 0 )
@@ -169,6 +170,7 @@ static int compat_find_digest(const char *name, PX_MD **res)
169170init = init_sha512 ;
170171else
171172return PXE_NO_HASH ;
173+
172174* res = px_alloc (sizeof (PX_MD ));
173175init (* res );
174176return 0 ;