Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a29cf6

Browse files
committed
Add forgotten CHECK_FOR_INTERRUPT calls in pgcrypto's crypt()
Both Blowfish and DES implementations of crypt() can take arbitrarilylong time, depending on the number of rounds specified by the caller;make sure they can be interrupted.Author: Andreas KarlssonReviewer: Jeff JanesBackpatch to 9.1.
1 parent70ff737 commit0a29cf6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎contrib/pgcrypto/crypt-blowfish.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434

3535
#include"postgres.h"
36+
#include"miscadmin.h"
3637

3738
#include"px-crypt.h"
3839
#include"px.h"
@@ -670,6 +671,8 @@ _crypt_blowfish_rn(const char *key, const char *setting,
670671

671672
do
672673
{
674+
CHECK_FOR_INTERRUPTS();
675+
673676
data.ctx.P[0] ^=data.expanded_key[0];
674677
data.ctx.P[1] ^=data.expanded_key[1];
675678
data.ctx.P[2] ^=data.expanded_key[2];

‎contrib/pgcrypto/crypt-des.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
*/
6262

6363
#include"postgres.h"
64+
#include"miscadmin.h"
6465

6566
#include"px-crypt.h"
6667

@@ -540,6 +541,8 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count)
540541

541542
while (count--)
542543
{
544+
CHECK_FOR_INTERRUPTS();
545+
543546
/*
544547
* Do each round.
545548
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp