Check for interrupts in bf and xdes crypt()

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Check for interrupts in bf and xdes crypt()
Date: 2015-12-15 08:35:41
Message-ID: 566FD0DD.4020303@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here is a patch which makes it possible to cancel a query which runs the
crypt() function with the bf or xdes hashing algorithm, e.g.
crypt('foo', gen_salt('bf', 13)). The md5 algorithm does not run for
multiple rounds so there is no reason to patch it.

I noticed this problem when I accidentally picked a too high n for the
number of hash rounds.

I have added a call to CHECK_FOR_INTERRUPTS() after every round, and I
could not measure any performance hit from this.

Andreas

Attachment Content-Type Size
crypt-interrupts-v01.patch text/x-diff 1003 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yang, Leo 2015-12-15 09:54:16 "pg_upgrade" cannot write to log file pg_upgrade_internal.log
Previous Message Simon Riggs 2015-12-15 07:17:15 Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename