int main(int argc, char** argv) { unsigned char buf[1024]; char out[2048+1]; if(argc > 1) return usage(argv[0]); while(1) { ssize_t n = read(0, buf, sizeof buf); if(n <= 0) break; raw2hex(out, buf, n); ulz_printf("%s", out); } ulz_printf("\n"); return 0; }
/* From cert to printable */ char * x509_printable(void *cert) { char *s; u_int8_t *data; u_int32_t datalen; x509_serialize(cert, &data, &datalen); if (!data) return 0; s = raw2hex(data, datalen); free(data); return s; }
/* * Return a string showing the hexadecimal contents of the LEN-sized buffer * BUF. MAPS should be zero and is only here because the API requires it. */ static char * field_debug_raw(u_int8_t *buf, size_t len, struct constant_map **maps) { return raw2hex(buf, len); }