Skip to content

Commit

Permalink
pgcrypto: Remove unused code
Browse files Browse the repository at this point in the history
The mbuf_tell, mbuf_rewind and pgp_get_cipher_name functions were
introduced in commit e94dd6a, but were never used, so remove.

Reviewed-by: Aleksander Alekseev <[email protected]>
Discussion: https://postgr.es/m/[email protected]
  • Loading branch information
danielgustafsson committed Sep 14, 2022
1 parent 5f84647 commit 1d3566f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
13 changes: 0 additions & 13 deletions contrib/pgcrypto/mbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ mbuf_size(MBuf *mbuf)
return mbuf->data_end - mbuf->data;
}

int
mbuf_tell(MBuf *mbuf)
{
return mbuf->read_pos - mbuf->data;
}

int
mbuf_free(MBuf *mbuf)
{
Expand Down Expand Up @@ -164,13 +158,6 @@ mbuf_grab(MBuf *mbuf, int len, uint8 **data_p)
return len;
}

int
mbuf_rewind(MBuf *mbuf)
{
mbuf->read_pos = mbuf->data;
return 0;
}

int
mbuf_steal_data(MBuf *mbuf, uint8 **data_p)
{
Expand Down
2 changes: 0 additions & 2 deletions contrib/pgcrypto/mbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ struct PullFilterOps
*/
MBuf *mbuf_create(int len);
MBuf *mbuf_create_from_data(uint8 *data, int len);
int mbuf_tell(MBuf *mbuf);
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_rewind(MBuf *mbuf);
int mbuf_free(MBuf *mbuf);

/*
Expand Down
10 changes: 0 additions & 10 deletions contrib/pgcrypto/pgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,6 @@ pgp_get_digest_name(int code)
return NULL;
}

const char *
pgp_get_cipher_name(int code)
{
const struct cipher_info *i = get_cipher_info(code);

if (i != NULL)
return i->name;
return NULL;
}

int
pgp_get_cipher_key_size(int code)
{
Expand Down
1 change: 0 additions & 1 deletion contrib/pgcrypto/pgp.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ int pgp_free(PGP_Context *ctx);
int pgp_get_digest_code(const char *name);
int pgp_get_cipher_code(const char *name);
const char *pgp_get_digest_name(int code);
const char *pgp_get_cipher_name(int code);

int pgp_set_cipher_algo(PGP_Context *ctx, const char *name);
int pgp_set_s2k_mode(PGP_Context *ctx, int type);
Expand Down

0 comments on commit 1d3566f

Please sign in to comment.