Module Name:    src
Committed By:   agc
Date:           Wed May  6 14:26:13 UTC 2009

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib: parse_local.h reader.c

Log Message:
Make it obvious what the pointer refers to, rather than its type.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/netpgp/dist/src/lib/reader.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h:1.3 src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h:1.4
--- src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h:1.3	Wed May  6 03:02:03 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/parse_local.h	Wed May  6 14:26:12 2009
@@ -39,7 +39,7 @@
 					 * (with this reader) */
 
 	__ops_reader_info_t *next;
-	__ops_parse_info_t *pinfo;/* !< A pointer back to the parent parse_info
+	__ops_parse_info_t *parent;/* !< A pointer back to the parent parse_info
 				 * structure */
 };
 

Index: src/crypto/external/bsd/netpgp/dist/src/lib/reader.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/reader.c:1.7 src/crypto/external/bsd/netpgp/dist/src/lib/reader.c:1.8
--- src/crypto/external/bsd/netpgp/dist/src/lib/reader.c:1.7	Wed May  6 03:02:03 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/reader.c	Wed May  6 14:26:12 2009
@@ -132,7 +132,7 @@
 	*rinfo = pinfo->rinfo;
 	(void) memset(&pinfo->rinfo, 0x0, sizeof(pinfo->rinfo));
 	pinfo->rinfo.next = rinfo;
-	pinfo->rinfo.pinfo = pinfo;
+	pinfo->rinfo.parent = pinfo;
 
 	/* should copy accumulate flags from other reader? RW */
 	pinfo->rinfo.accumulate = rinfo->accumulate;
@@ -1239,16 +1239,16 @@
 	 * V3 MPIs have the count plain and the cipher is reset after each
 	 * count
 	 */
-	if (encrypted->prev_read_was_plain && !rinfo->pinfo->reading_mpi_length) {
-		if (!rinfo->pinfo->reading_v3_secret) {
+	if (encrypted->prev_read_was_plain && !rinfo->parent->reading_mpi_length) {
+		if (!rinfo->parent->reading_v3_secret) {
 			(void) fprintf(stderr,
 				"encrypted_data_reader: bad v3 secret\n");
 			return -1;
 		}
 		encrypted->decrypt->decrypt_resync(encrypted->decrypt);
 		encrypted->prev_read_was_plain = false;
-	} else if (rinfo->pinfo->reading_v3_secret &&
-		   rinfo->pinfo->reading_mpi_length) {
+	} else if (rinfo->parent->reading_v3_secret &&
+		   rinfo->parent->reading_mpi_length) {
 		encrypted->prev_read_was_plain = true;
 	}
 	while (length > 0) {
@@ -1259,8 +1259,8 @@
 			 * if we are reading v3 we should never read
 			 * more than we're asked for */
 			if (length < encrypted->decrypted_count &&
-			     (rinfo->pinfo->reading_v3_secret ||
-			      rinfo->pinfo->exact_read)) {
+			     (rinfo->parent->reading_v3_secret ||
+			      rinfo->parent->exact_read)) {
 				(void) fprintf(stderr,
 					"encrypted_data_reader: bad v3 read\n");
 				return 0;
@@ -1293,20 +1293,20 @@
 			}
 
 			/*
-			 * we can only read as much as we're asked for in v3
-			 * keys
-			 */
-			/* because they're partially unencrypted! */
-			if ((rinfo->pinfo->reading_v3_secret || rinfo->pinfo->exact_read)
-			    && n > length)
+			 * we can only read as much as we're asked for
+			 * in v3 keys because they're partially
+			 * unencrypted!  */
+			if ((rinfo->parent->reading_v3_secret ||
+			     rinfo->parent->exact_read) && n > length) {
 				n = length;
+			}
 
 			if (!__ops_stacked_limited_read(buffer, n, encrypted->region, errors, rinfo,
 						      cbinfo)) {
 				return -1;
 			}
-			if (!rinfo->pinfo->reading_v3_secret ||
-			    !rinfo->pinfo->reading_mpi_length) {
+			if (!rinfo->parent->reading_v3_secret ||
+			    !rinfo->parent->reading_mpi_length) {
 				encrypted->decrypted_count = __ops_decrypt_se_ip(encrypted->decrypt,
 							     encrypted->decrypted,
 								 buffer, n);

Reply via email to