Lines Matching refs:linebuf
701 static int sanitize_line(char *linebuf, int len, unsigned int flags, int first_call) in sanitize_line() argument
709 if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) { in sanitize_line()
710 memmove(linebuf, linebuf + 3, len - 3); in sanitize_line()
711 linebuf[len - 3] = 0; in sanitize_line()
718 while ((len >= 0) && (linebuf[len] <= ' ')) in sanitize_line()
724 if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n' in sanitize_line()
725 || linebuf[i] == '\r') in sanitize_line()
733 if (linebuf[i] == '\n' || linebuf[i] == '\r') in sanitize_line()
735 if (ossl_iscntrl(linebuf[i])) in sanitize_line()
736 linebuf[i] = ' '; in sanitize_line()
741 linebuf[len++] = '\n'; in sanitize_line()
742 linebuf[len] = '\0'; in sanitize_line()
756 char *linebuf; in get_name() local
765 linebuf = PEM_MALLOC(LINESIZE + 1, flags); in get_name()
766 if (linebuf == NULL) in get_name()
770 len = BIO_gets(bp, linebuf, LINESIZE); in get_name()
778 len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call); in get_name()
782 } while (!HAS_PREFIX(linebuf, BEGINSTR) in get_name()
784 || !HAS_PREFIX(linebuf + len - TAILLEN, TAILSTR)); in get_name()
785 linebuf[len - TAILLEN] = '\0'; in get_name()
790 memcpy(*name, linebuf + BEGINLEN, len); in get_name()
794 PEM_FREE(linebuf, flags, LINESIZE + 1); in get_name()
820 char *linebuf, *p; in get_header_and_data() local
829 linebuf = PEM_MALLOC(LINESIZE + 1, flags); in get_header_and_data()
830 if (linebuf == NULL) in get_header_and_data()
835 len = BIO_gets(bp, linebuf, LINESIZE); in get_header_and_data()
847 partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n'; in get_header_and_data()
850 if (memchr(linebuf, ':', len) != NULL) in get_header_and_data()
853 if (HAS_PREFIX(linebuf, ENDSTR) || got_header == IN_HEADER) in get_header_and_data()
855 len = sanitize_line(linebuf, len, flags & flags_mask, 0); in get_header_and_data()
858 if (linebuf[0] == '\n') { in get_header_and_data()
876 p = linebuf; in get_header_and_data()
898 if (BIO_puts(tmp, linebuf) < 0) in get_header_and_data()
914 PEM_FREE(linebuf, flags, LINESIZE + 1); in get_header_and_data()