1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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.
This commit is contained in:
Alvaro Herrera
2015-12-27 13:03:19 -03:00
parent c03e442450
commit 0244677cf1
2 changed files with 6 additions and 0 deletions

View File

@ -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.
*/