Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib Don't prefix functio...
details: https://anonhg.NetBSD.org/src/rev/43150e7267bd
branches: trunk
changeset: 758774:43150e7267bd
user: agc <agc%NetBSD.org@localhost>
date: Mon Nov 15 08:50:32 2010 +0000
description:
Don't prefix function names with "pgp_" if the functions are static.
diffstat:
crypto/external/bsd/netpgp/dist/src/lib/crypto.c | 4 +-
crypto/external/bsd/netpgp/dist/src/lib/keyring.c | 14 +++---
crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c | 33 ++++++++---------
crypto/external/bsd/netpgp/dist/src/lib/packet-print.c | 18 ++++----
crypto/external/bsd/netpgp/dist/src/lib/packet-show.c | 6 +-
crypto/external/bsd/netpgp/dist/src/lib/reader.c | 13 +++---
crypto/external/bsd/netpgp/dist/src/lib/writer.c | 14 +++---
7 files changed, 50 insertions(+), 52 deletions(-)
diffs (truncated from 455 to 300 lines):
diff -r 15f2255e1df3 -r 43150e7267bd crypto/external/bsd/netpgp/dist/src/lib/crypto.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/crypto.c Mon Nov 15 08:35:52 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/crypto.c Mon Nov 15 08:50:32 2010 +0000
@@ -54,7 +54,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: crypto.c,v 1.32 2010/11/07 08:39:59 agc Exp $");
+__RCSID("$NetBSD: crypto.c,v 1.33 2010/11/15 08:50:32 agc Exp $");
#endif
#include <sys/types.h>
@@ -316,7 +316,7 @@
case PGP_PTAG_CT_SE_DATA_BODY:
case PGP_PTAG_CT_SE_DATA_HEADER:
/* Ignore these packets */
- /* They're handled in pgp_parse_packet() */
+ /* They're handled in parse_packet() */
/* and nothing else needs to be done */
break;
diff -r 15f2255e1df3 -r 43150e7267bd crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Nov 15 08:35:52 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Nov 15 08:50:32 2010 +0000
@@ -57,7 +57,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.48 2010/11/07 08:39:59 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.49 2010/11/15 08:50:32 agc Exp $");
#endif
#ifdef HAVE_FCNTL_H
@@ -398,7 +398,7 @@
\note If dst already has a userid, it will be freed.
*/
static uint8_t *
-pgp_copy_userid(uint8_t **dst, const uint8_t *src)
+copy_userid(uint8_t **dst, const uint8_t *src)
{
size_t len;
@@ -407,7 +407,7 @@
free(*dst);
}
if ((*dst = calloc(1, len + 1)) == NULL) {
- (void) fprintf(stderr, "pgp_copy_userid: bad alloc\n");
+ (void) fprintf(stderr, "copy_userid: bad alloc\n");
} else {
(void) memcpy(*dst, src, len);
}
@@ -423,13 +423,13 @@
\note If dst already has a packet, it will be freed.
*/
static pgp_subpacket_t *
-pgp_copy_packet(pgp_subpacket_t *dst, const pgp_subpacket_t *src)
+copy_packet(pgp_subpacket_t *dst, const pgp_subpacket_t *src)
{
if (dst->raw) {
free(dst->raw);
}
if ((dst->raw = calloc(1, src->length)) == NULL) {
- (void) fprintf(stderr, "pgp_copy_packet: bad alloc\n");
+ (void) fprintf(stderr, "copy_packet: bad alloc\n");
} else {
dst->length = src->length;
(void) memcpy(dst->raw, src->raw, src->length);
@@ -454,7 +454,7 @@
uidp = &key->uids[key->uidc++];
*uidp = NULL;
/* now copy it */
- return pgp_copy_userid(uidp, userid);
+ return copy_userid(uidp, userid);
}
void print_packet_hex(const pgp_subpacket_t *pkt);
@@ -477,7 +477,7 @@
subpktp->length = 0;
subpktp->raw = NULL;
/* now copy it */
- return pgp_copy_packet(subpktp, packet);
+ return copy_packet(subpktp, packet);
}
/**
diff -r 15f2255e1df3 -r 43150e7267bd crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c Mon Nov 15 08:35:52 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c Mon Nov 15 08:50:32 2010 +0000
@@ -58,7 +58,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-parse.c,v 1.48 2010/11/15 08:03:40 agc Exp $");
+__RCSID("$NetBSD: packet-parse.c,v 1.49 2010/11/15 08:50:32 agc Exp $");
#endif
#include <sys/types.h>
@@ -871,7 +871,7 @@
\brief Free allocated memory
*/
static void
-pgp_headers_free(pgp_headers_t *headers)
+headers_free(pgp_headers_t *headers)
{
unsigned n;
@@ -899,7 +899,7 @@
\brief Free allocated memory
*/
static void
-pgp_cmd_get_passphrase_free(pgp_seckey_passphrase_t *skp)
+cmd_get_passphrase_free(pgp_seckey_passphrase_t *skp)
{
if (skp->passphrase && *skp->passphrase) {
free(*skp->passphrase);
@@ -995,11 +995,11 @@
break;
case PGP_PTAG_CT_SIGNED_CLEARTEXT_HEADER:
- pgp_headers_free(&c->u.cleartext_head);
+ headers_free(&c->u.cleartext_head);
break;
case PGP_PTAG_CT_ARMOUR_HEADER:
- pgp_headers_free(&c->u.armour_header.headers);
+ headers_free(&c->u.armour_header.headers);
break;
case PGP_PTAG_CT_SIGNED_CLEARTEXT_TRAILER:
@@ -1118,7 +1118,7 @@
break;
case PGP_GET_PASSPHRASE:
- pgp_cmd_get_passphrase_free(&c->u.skey_passphrase);
+ cmd_get_passphrase_free(&c->u.skey_passphrase);
break;
default:
@@ -2868,7 +2868,7 @@
}
static int
-pgp_decrypt_se_data(pgp_content_enum tag, pgp_region_t *region,
+decrypt_se_data(pgp_content_enum tag, pgp_region_t *region,
pgp_stream_t *stream)
{
pgp_crypt_t *decrypt;
@@ -2928,7 +2928,7 @@
}
static int
-pgp_decrypt_se_ip_data(pgp_content_enum tag, pgp_region_t *region,
+decrypt_se_ip_data(pgp_content_enum tag, pgp_region_t *region,
pgp_stream_t *stream)
{
pgp_crypt_t *decrypt;
@@ -2938,7 +2938,7 @@
decrypt = pgp_get_decrypt(stream);
if (decrypt) {
if (pgp_get_debug_level(__FILE__)) {
- (void) fprintf(stderr, "pgp_decrypt_se_ip_data: decrypt\n");
+ (void) fprintf(stderr, "decrypt_se_ip_data: decrypt\n");
}
pgp_reader_push_decrypt(stream, decrypt, region);
pgp_reader_push_se_ip_data(stream, decrypt, region);
@@ -2951,7 +2951,7 @@
pgp_packet_t pkt;
if (pgp_get_debug_level(__FILE__)) {
- (void) fprintf(stderr, "pgp_decrypt_se_ip_data: no decrypt\n");
+ (void) fprintf(stderr, "decrypt_se_ip_data: no decrypt\n");
}
while (region->readc < region->length) {
unsigned len;
@@ -2991,7 +2991,7 @@
* The content of an encrypted data packet is more OpenPGP packets
* once decrypted, so recursively handle them
*/
- return pgp_decrypt_se_data(PGP_PTAG_CT_SE_DATA_BODY, region, stream);
+ return decrypt_se_data(PGP_PTAG_CT_SE_DATA_BODY, region, stream);
}
/**
@@ -3025,8 +3025,7 @@
* The content of an encrypted data packet is more OpenPGP packets
* once decrypted, so recursively handle them
*/
- return pgp_decrypt_se_ip_data(PGP_PTAG_CT_SE_IP_DATA_BODY, region,
- stream);
+ return decrypt_se_ip_data(PGP_PTAG_CT_SE_IP_DATA_BODY, region, stream);
}
/**
@@ -3063,7 +3062,7 @@
* \param *pktlen On return, will contain number of bytes in packet
* \return 1 on success, 0 on error, -1 on EOF */
static int
-pgp_parse_packet(pgp_stream_t *stream, uint32_t *pktlen)
+parse_packet(pgp_stream_t *stream, uint32_t *pktlen)
{
pgp_packet_t pkt;
pgp_region_t region;
@@ -3077,7 +3076,7 @@
if (pgp_get_debug_level(__FILE__)) {
(void) fprintf(stderr,
- "pgp_parse_packet: base_read returned %d, ptag %d\n",
+ "parse_packet: base_read returned %d, ptag %d\n",
ret, ptag);
}
@@ -3138,7 +3137,7 @@
region.length = pkt.u.ptag.length;
region.indeterminate = indeterminate;
if (pgp_get_debug_level(__FILE__)) {
- (void) fprintf(stderr, "pgp_parse_packet: type %u\n",
+ (void) fprintf(stderr, "parse_packet: type %u\n",
pkt.u.ptag.type);
}
switch (pkt.u.ptag.type) {
@@ -3276,7 +3275,7 @@
int r;
do {
- r = pgp_parse_packet(stream, &pktlen);
+ r = parse_packet(stream, &pktlen);
} while (r != -1);
if (perrors) {
pgp_print_errors(stream->errors);
diff -r 15f2255e1df3 -r 43150e7267bd crypto/external/bsd/netpgp/dist/src/lib/packet-print.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c Mon Nov 15 08:35:52 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c Mon Nov 15 08:50:32 2010 +0000
@@ -58,7 +58,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-print.c,v 1.39 2010/11/07 08:39:59 agc Exp $");
+__RCSID("$NetBSD: packet-print.c,v 1.40 2010/11/15 08:50:32 agc Exp $");
#endif
#include <string.h>
@@ -732,7 +732,7 @@
\param seckey
*/
static void
-pgp_print_seckey_verbose(const pgp_content_enum type,
+print_seckey_verbose(const pgp_content_enum type,
const pgp_seckey_t *seckey)
{
printf("------- SECRET KEY or ENCRYPTED SECRET KEY ------\n");
@@ -774,7 +774,7 @@
default:
(void) fprintf(stderr,
- "pgp_print_seckey_verbose: unusual algorithm\n");
+ "print_seckey_verbose: unusual algorithm\n");
}
if (seckey->s2k_usage == PGP_S2KU_ENCRYPTED_AND_HASHED) {
print_hexdump(0, "Checkhash", seckey->checkhash,
@@ -792,7 +792,7 @@
\param key
*/
static void
-pgp_print_pk_sesskey(pgp_content_enum tag,
+print_pk_sesskey(pgp_content_enum tag,
const pgp_pk_sesskey_t * key)
{
print_tagname(0, (tag == PGP_PTAG_CT_PK_SESSION_KEY) ?
@@ -814,7 +814,7 @@
default:
(void) fprintf(stderr,
- "pgp_print_pk_sesskey: unusual algorithm\n");
+ "print_pk_sesskey: unusual algorithm\n");
}
if (tag == PGP_PTAG_CT_PK_SESSION_KEY) {
printf("Symmetric algorithm: %d (%s)\n", key->symm_alg,
@@ -1345,12 +1345,12 @@
case PGP_PTAG_CT_SECRET_KEY:
print_tagname(print->indent, "PGP_PTAG_CT_SECRET_KEY");
- pgp_print_seckey_verbose(pkt->tag, &content->seckey);
+ print_seckey_verbose(pkt->tag, &content->seckey);
break;
case PGP_PTAG_CT_ENCRYPTED_SECRET_KEY:
print_tagname(print->indent, "PGP_PTAG_CT_ENCRYPTED_SECRET_KEY");
- pgp_print_seckey_verbose(pkt->tag, &content->seckey);
+ print_seckey_verbose(pkt->tag, &content->seckey);
break;
case PGP_PTAG_CT_ARMOUR_HEADER:
@@ -1394,11 +1394,11 @@
case PGP_PTAG_CT_PK_SESSION_KEY:
case PGP_PTAG_CT_ENCRYPTED_PK_SESSION_KEY:
- pgp_print_pk_sesskey(pkt->tag, &content->pk_sesskey);
+ print_pk_sesskey(pkt->tag, &content->pk_sesskey);
break;
Home |
Main Index |
Thread Index |
Old Index