diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-12-27 13:03:19 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-12-27 13:03:19 -0300 |
commit | 743229a67e24aaee3f671bc5692100fe94c47436 (patch) | |
tree | 957d27ec940b2d66d89aa6625b7678547380c800 /contrib/pgcrypto/crypt-des.c | |
parent | fec1ad94dfc5ddacfda8d249bf4b3c739da8f7a1 (diff) |
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.
Diffstat (limited to 'contrib/pgcrypto/crypt-des.c')
-rw-r--r-- | contrib/pgcrypto/crypt-des.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index 682958600a6..a4aa4966bfc 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-crypt.h" @@ -540,6 +541,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. */ |