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 | 0a29cf693d385a60fb37c1f396af6fd8ffadc2e6 (patch) | |
| tree | a7ebeb4dacfbe702d4de932fbef8d1153c80b891 /contrib/pgcrypto/crypt-blowfish.c | |
| parent | 70ff73717004912a27506f31ef3c6aef77d64708 (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-blowfish.c')
| -rw-r--r-- | contrib/pgcrypto/crypt-blowfish.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c index 4054e6a06fc..6feaefcf7be 100644 --- a/contrib/pgcrypto/crypt-blowfish.c +++ b/contrib/pgcrypto/crypt-blowfish.c @@ -33,6 +33,7 @@ */ #include "postgres.h" +#include "miscadmin.h" #include "px-crypt.h" #include "px.h" @@ -670,6 +671,8 @@ _crypt_blowfish_rn(const char *key, const char *setting, do { + CHECK_FOR_INTERRUPTS(); + data.ctx.P[0] ^= data.expanded_key[0]; data.ctx.P[1] ^= data.expanded_key[1]; data.ctx.P[2] ^= data.expanded_key[2]; |
