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.
*/
#include "postgres.h"
+#include "miscadmin.h"
#include "px-crypt.h"
#include "px.h"
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];
*/
#include "postgres.h"
+#include "miscadmin.h"
#include "px-crypt.h"
while (count--)
{
+ CHECK_FOR_INTERRUPTS();
+
/*
* Do each round.
*/