Skip to content

Commit

Permalink
more prints
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Oct 13, 2023
1 parent e25774a commit 2ce3be8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/pem.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,13 @@ int s_extract_header_type_cur(struct aws_byte_cursor cur, struct aws_byte_cursor
}

aws_byte_cursor_advance(&cur, s_begin_header_cur.len);
AWS_LOGF_ERROR(AWS_LS_IO_PEM, "Invalid PEM buffer: invalid end token %d:"PRInSTR, cur.len, AWS_BYTE_CURSOR_PRI(cur));
aws_byte_cursor_advance(&cur, 1); // space after begin
AWS_LOGF_ERROR(AWS_LS_IO_PEM, "Invalid PEM buffer: invalid end token %d:"PRInSTR, cur.len, AWS_BYTE_CURSOR_PRI(cur));
struct aws_byte_cursor type_cur = aws_byte_cursor_advance(&cur, cur.len - s_delim_cur.len);

if (!aws_byte_cursor_eq(&cur, &s_delim_cur)) {
AWS_LOGF_ERROR(AWS_LS_IO_PEM, "Invalid PEM buffer: invalid end token :"PRInSTR, AWS_BYTE_CURSOR_PRI(cur));
AWS_LOGF_ERROR(AWS_LS_IO_PEM, "Invalid PEM buffer: invalid end token %d:"PRInSTR, cur.len, AWS_BYTE_CURSOR_PRI(cur));
return aws_raise_error(AWS_ERROR_PEM_MALFORMED);
}

Expand Down

0 comments on commit 2ce3be8

Please sign in to comment.