Codebase list openssl / 751485c
Remove code that prints "<SPACES/NULS>" in hexdumps when the data block ends with SPACEs or NULs. The problem is, you can't see if the data ends with SPACE or NUL or a combination of both. This can happen for instance with openssl rsautl -decrypt -hexdump Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5332) Bernd Edlinger 6 years ago
1 changed file(s) with 2 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
1313 #include <stdio.h>
1414 #include "bio_lcl.h"
1515
16 #define TRUNCATE
1716 #define DUMP_WIDTH 16
1817 #define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH-((i-(i>6?6:i)+3)/4))
1918
2827 {
2928 int ret = 0;
3029 char buf[288 + 1], tmp[20], str[128 + 1];
31 int i, j, rows, trc;
30 int i, j, rows;
3231 unsigned char ch;
3332 int dump_width;
34
35 trc = 0;
36
37 #ifdef TRUNCATE
38 for (; (len > 0) && ((s[len - 1] == ' ') || (s[len - 1] == '\0')); len--)
39 trc++;
40 #endif
4133
4234 if (indent < 0)
4335 indent = 0;
8981 */
9082 ret += cb((void *)buf, strlen(buf), u);
9183 }
92 #ifdef TRUNCATE
93 if (trc > 0) {
94 BIO_snprintf(buf, sizeof(buf), "%s%04x - <SPACES/NULS>\n", str,
95 len + trc);
96 ret += cb((void *)buf, strlen(buf), u);
97 }
98 #endif
99 return (ret);
84 return ret;
10085 }
10186
10287 #ifndef OPENSSL_NO_STDIO