summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-09-22 13:59:20 -0700
committerPeter Geoghegan <pg@bowt.ie>2022-09-22 13:59:20 -0700
commit0faf7d933f625eb1668dcaa518b472f722b53a55 (patch)
tree5fce7103c75871bec2ec1636d8751245cb7374a0 /contrib/pgcrypto
parent8fb4e001e9c185250a95b2b13880a2a04d626b75 (diff)
downloadpostgresql-0faf7d933f625eb1668dcaa518b472f722b53a55.tar.gz
Harmonize parameter names in contrib code.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in contrib code. Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Diffstat (limited to 'contrib/pgcrypto')
-rw-r--r--contrib/pgcrypto/mbuf.h18
-rw-r--r--contrib/pgcrypto/pgcrypto.c3
-rw-r--r--contrib/pgcrypto/pgp.h32
-rw-r--r--contrib/pgcrypto/px-crypt.h6
-rw-r--r--contrib/pgcrypto/px.h2
5 files changed, 31 insertions, 30 deletions
diff --git a/contrib/pgcrypto/mbuf.h b/contrib/pgcrypto/mbuf.h
index adb18430b7..97873c931f 100644
--- a/contrib/pgcrypto/mbuf.h
+++ b/contrib/pgcrypto/mbuf.h
@@ -82,33 +82,33 @@ int mbuf_avail(MBuf *mbuf);
int mbuf_size(MBuf *mbuf);
int mbuf_grab(MBuf *mbuf, int len, uint8 **data_p);
int mbuf_steal_data(MBuf *mbuf, uint8 **data_p);
-int mbuf_append(MBuf *dst, const uint8 *buf, int cnt);
+int mbuf_append(MBuf *dst, const uint8 *buf, int len);
int mbuf_free(MBuf *mbuf);
/*
* Push filter
*/
-int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
- PushFilter *next);
+int pushf_create(PushFilter **mp_p, const PushFilterOps *op,
+ void *init_arg, PushFilter *next);
int pushf_write(PushFilter *mp, const uint8 *data, int len);
void pushf_free_all(PushFilter *mp);
void pushf_free(PushFilter *mp);
int pushf_flush(PushFilter *mp);
-int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
+int pushf_create_mbuf_writer(PushFilter **res, MBuf *dst);
/*
* Pull filter
*/
-int pullf_create(PullFilter **res, const PullFilterOps *ops,
+int pullf_create(PullFilter **pf_p, const PullFilterOps *op,
void *init_arg, PullFilter *src);
-int pullf_read(PullFilter *mp, int len, uint8 **data_p);
-int pullf_read_max(PullFilter *mp, int len,
+int pullf_read(PullFilter *pf, int len, uint8 **data_p);
+int pullf_read_max(PullFilter *pf, int len,
uint8 **data_p, uint8 *tmpbuf);
-void pullf_free(PullFilter *mp);
+void pullf_free(PullFilter *pf);
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
-int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
+int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src);
#define GETBYTE(pf, dst) \
do { \
diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index f0ac625040..8f882f4c68 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -45,7 +45,8 @@ PG_MODULE_MAGIC;
/* private stuff */
typedef int (*PFN) (const char *name, void **res);
-static void *find_provider(text *name, PFN pf, const char *desc, int silent);
+static void *find_provider(text *name, PFN provider_lookup, const char *desc,
+ int silent);
/* SQL function: hash(bytea, text) returns bytea */
PG_FUNCTION_INFO_V1(pg_digest);
diff --git a/contrib/pgcrypto/pgp.h b/contrib/pgcrypto/pgp.h
index 805f01af5b..cb8b32aba0 100644
--- a/contrib/pgcrypto/pgp.h
+++ b/contrib/pgcrypto/pgp.h
@@ -236,9 +236,9 @@ struct PGP_PubKey
int can_encrypt;
};
-int pgp_init(PGP_Context **ctx);
+int pgp_init(PGP_Context **ctx_p);
int pgp_encrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
-int pgp_decrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
+int pgp_decrypt(PGP_Context *ctx, MBuf *msrc, MBuf *mdst);
int pgp_free(PGP_Context *ctx);
int pgp_get_digest_code(const char *name);
@@ -246,7 +246,7 @@ int pgp_get_cipher_code(const char *name);
const char *pgp_get_digest_name(int code);
int pgp_set_cipher_algo(PGP_Context *ctx, const char *name);
-int pgp_set_s2k_mode(PGP_Context *ctx, int type);
+int pgp_set_s2k_mode(PGP_Context *ctx, int mode);
int pgp_set_s2k_count(PGP_Context *ctx, int count);
int pgp_set_s2k_cipher_algo(PGP_Context *ctx, const char *name);
int pgp_set_s2k_digest_algo(PGP_Context *ctx, const char *name);
@@ -259,22 +259,22 @@ int pgp_set_text_mode(PGP_Context *ctx, int mode);
int pgp_set_unicode_mode(PGP_Context *ctx, int mode);
int pgp_get_unicode_mode(PGP_Context *ctx);
-int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen);
+int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int len);
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
- const uint8 *key, int klen, int pubtype);
+ const uint8 *key, int key_len, int pubtype);
int pgp_get_keyid(MBuf *pgp_data, char *dst);
/* internal functions */
-int pgp_load_digest(int c, PX_MD **res);
-int pgp_load_cipher(int c, PX_Cipher **res);
-int pgp_get_cipher_key_size(int c);
-int pgp_get_cipher_block_size(int c);
+int pgp_load_digest(int code, PX_MD **res);
+int pgp_load_cipher(int code, PX_Cipher **res);
+int pgp_get_cipher_key_size(int code);
+int pgp_get_cipher_block_size(int code);
int pgp_s2k_fill(PGP_S2K *s2k, int mode, int digest_algo, int count);
int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k);
-int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen);
+int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int key_len);
typedef struct PGP_CFB PGP_CFB;
int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
@@ -316,11 +316,11 @@ int pgp_mpi_write(PushFilter *dst, PGP_MPI *n);
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n);
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n);
-int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
- PGP_MPI **c1, PGP_MPI **c2);
-int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
- PGP_MPI **m);
-int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c);
-int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m);
+int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
+ PGP_MPI **c1_p, PGP_MPI **c2_p);
+int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
+ PGP_MPI **msg_p);
+int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p);
+int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p);
extern struct PullFilterOps pgp_decrypt_filter;
diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h
index 08001a81f5..54de806965 100644
--- a/contrib/pgcrypto/px-crypt.h
+++ b/contrib/pgcrypto/px-crypt.h
@@ -48,8 +48,8 @@
/*
* main interface
*/
-char *px_crypt(const char *psw, const char *salt, char *buf, unsigned buflen);
-int px_gen_salt(const char *salt_type, char *dst, int rounds);
+char *px_crypt(const char *psw, const char *salt, char *buf, unsigned len);
+int px_gen_salt(const char *salt_type, char *buf, int rounds);
/*
* internal functions
@@ -77,6 +77,6 @@ char *px_crypt_des(const char *key, const char *setting);
/* crypt-md5.c */
char *px_crypt_md5(const char *pw, const char *salt,
- char *dst, unsigned dstlen);
+ char *passwd, unsigned dstlen);
#endif /* _PX_CRYPT_H */
diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h
index 4ef40f3f1c..471bb4ec72 100644
--- a/contrib/pgcrypto/px.h
+++ b/contrib/pgcrypto/px.h
@@ -176,7 +176,7 @@ int px_find_combo(const char *name, PX_Combo **res);
void px_THROW_ERROR(int err) pg_attribute_noreturn();
const char *px_strerror(int err);
-const char *px_resolve_alias(const PX_Alias *aliases, const char *name);
+const char *px_resolve_alias(const PX_Alias *list, const char *name);
void px_set_debug_handler(void (*handler) (const char *));