From 1b6102eb73f4483eb30f3008b07882a93ff369f8 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Sun, 27 Dec 2015 13:03:19 -0300 Subject: Add forgotten CHECK_FOR_INTERRUPT calls in pgcrypto's crypt() Both Blowfish and DES implementations of crypt() can take arbitrarily long time, depending on the number of rounds specified by the caller; make sure they can be interrupted. Author: Andreas Karlsson Reviewer: Jeff Janes Backpatch to 9.1. --- contrib/pgcrypto/crypt-des.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/pgcrypto/crypt-des.c') diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index 6834c28cf2f..e2501787a02 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -61,6 +61,7 @@ */ #include "postgres.h" +#include "miscadmin.h" #include "px.h" #include "px-crypt.h" @@ -541,6 +542,8 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count) while (count--) { + CHECK_FOR_INTERRUPTS(); + /* * Do each round. */ -- cgit v1.2.3