diff options
Diffstat (limited to 'contrib/pgcrypto')
-rw-r--r-- | contrib/pgcrypto/crypt-blowfish.c | 6 | ||||
-rw-r--r-- | contrib/pgcrypto/crypt-des.c | 4 | ||||
-rw-r--r-- | contrib/pgcrypto/crypt-gensalt.c | 6 | ||||
-rw-r--r-- | contrib/pgcrypto/crypt-md5.c | 20 |
4 files changed, 18 insertions, 18 deletions
diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c index 7cca92b6ab5..b49747d9265 100644 --- a/contrib/pgcrypto/crypt-blowfish.c +++ b/contrib/pgcrypto/crypt-blowfish.c @@ -371,7 +371,7 @@ BF_decode(BF_word *dst, const char *src, int size) { unsigned char *dptr = (unsigned char *) dst; unsigned char *end = dptr + size; - unsigned char *sptr = (unsigned char *) src; + const unsigned char *sptr = (const unsigned char *) src; unsigned int tmp, c1, c2, @@ -401,8 +401,8 @@ BF_decode(BF_word *dst, const char *src, int size) static void BF_encode(char *dst, const BF_word *src, int size) { - unsigned char *sptr = (unsigned char *) src; - unsigned char *end = sptr + size; + const unsigned char *sptr = (const unsigned char *) src; + const unsigned char *end = sptr + size; unsigned char *dptr = (unsigned char *) dst; unsigned int c1, c2; diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index e50c1f4a925..44475a1b446 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -407,8 +407,8 @@ des_setkey(const char *key) if (!des_initialised) des_init(); - rawkey0 = ntohl(*(uint32 *) key); - rawkey1 = ntohl(*(uint32 *) (key + 4)); + rawkey0 = ntohl(*(const uint32 *) key); + rawkey1 = ntohl(*(const uint32 *) (key + 4)); if ((rawkey0 | rawkey1) && rawkey0 == old_rawkey0 diff --git a/contrib/pgcrypto/crypt-gensalt.c b/contrib/pgcrypto/crypt-gensalt.c index 062ab864167..ec2e0fa0250 100644 --- a/contrib/pgcrypto/crypt-gensalt.c +++ b/contrib/pgcrypto/crypt-gensalt.c @@ -123,8 +123,8 @@ static unsigned char BF_itoa64[64 + 1] = static void BF_encode(char *dst, const BF_word *src, int size) { - unsigned char *sptr = (unsigned char *) src; - unsigned char *end = sptr + size; + const unsigned char *sptr = (const unsigned char *) src; + const unsigned char *end = sptr + size; unsigned char *dptr = (unsigned char *) dst; unsigned int c1, c2; @@ -180,7 +180,7 @@ _crypt_gensalt_blowfish_rn(unsigned long count, output[5] = '0' + count % 10; output[6] = '$'; - BF_encode(&output[7], (BF_word *) input, 16); + BF_encode(&output[7], (const BF_word *) input, 16); output[7 + 22] = '\0'; return output; diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c index 30eb8bf5a27..2215f38d8bf 100644 --- a/contrib/pgcrypto/crypt-md5.c +++ b/contrib/pgcrypto/crypt-md5.c @@ -72,18 +72,18 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) err = px_find_digest("md5", &ctx1); /* The password first, since that is what is most unknown */ - px_md_update(ctx, (uint8 *) pw, strlen(pw)); + px_md_update(ctx, (const uint8 *) pw, strlen(pw)); /* Then our magic string */ px_md_update(ctx, (uint8 *) magic, strlen(magic)); /* Then the raw salt */ - px_md_update(ctx, (uint8 *) sp, sl); + px_md_update(ctx, (const uint8 *) sp, sl); /* Then just as many characters of the MD5(pw,salt,pw) */ - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); - px_md_update(ctx1, (uint8 *) sp, sl); - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) sp, sl); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); px_md_finish(ctx1, final); for (pl = strlen(pw); pl > 0; pl -= MD5_SIZE) px_md_update(ctx, final, pl > MD5_SIZE ? MD5_SIZE : pl); @@ -96,7 +96,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) if (i & 1) px_md_update(ctx, final, 1); else - px_md_update(ctx, (uint8 *) pw, 1); + px_md_update(ctx, (const uint8 *) pw, 1); /* Now make the output string */ strcpy(passwd, magic); @@ -114,20 +114,20 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen) { px_md_reset(ctx1); if (i & 1) - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); else px_md_update(ctx1, final, MD5_SIZE); if (i % 3) - px_md_update(ctx1, (uint8 *) sp, sl); + px_md_update(ctx1, (const uint8 *) sp, sl); if (i % 7) - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); if (i & 1) px_md_update(ctx1, final, MD5_SIZE); else - px_md_update(ctx1, (uint8 *) pw, strlen(pw)); + px_md_update(ctx1, (const uint8 *) pw, strlen(pw)); px_md_finish(ctx1, final); } |