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

Commitdec2c77

Browse files
author
Neil Conway
committed
Prevent pgcrypto from successfully compiling if no valid random source
has been defined. Previously, pgcrypto would compile but would beunusable.
1 parent2663e0c commitdec2c77

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎contrib/pgcrypto/random.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/random.c,v 1.7 2003/11/29 22:39:28 pgsql Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/random.c,v 1.8 2004/11/23 23:44:08 neilc Exp $
3030
*/
3131

3232

@@ -35,7 +35,7 @@
3535
#include"px.h"
3636

3737

38-
#ifdefRAND_DEV
38+
#if defined(RAND_DEV)
3939

4040
#include<errno.h>
4141
#include<fcntl.h>
@@ -77,9 +77,8 @@ px_get_random_bytes(uint8 *dst, unsigned count)
7777
close(fd);
7878
returnres;
7979
}
80-
#endif/* RAND_DEV */
8180

82-
#ifdefRAND_SILLY
81+
#elif defined(RAND_SILLY)
8382

8483
int
8584
px_get_random_bytes(uint8*dst,unsignedcount)
@@ -90,9 +89,8 @@ px_get_random_bytes(uint8 *dst, unsigned count)
9089
*dst++=random();
9190
returni;
9291
}
93-
#endif/* RAND_SILLY */
9492

95-
#ifdefRAND_OPENSSL
93+
#elif defined(RAND_OPENSSL)
9694

9795
#include<openssl/evp.h>
9896
#include<openssl/blowfish.h>
@@ -125,4 +123,6 @@ px_get_random_bytes(uint8 *dst, unsigned count)
125123
return-1;
126124
}
127125

128-
#endif/* RAND_OPENSSL */
126+
#else
127+
#error "Invalid random source"
128+
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp