mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
AppleM1: Update openssl to v1.1.1l
This commit is contained in:
parent
1fe12b8e8c
commit
b787656eea
990 changed files with 13406 additions and 18710 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include <string.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/buffer.h>
|
||||
|
@ -18,7 +18,7 @@
|
|||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include <openssl/des.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
|
@ -332,7 +332,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
|
|||
}
|
||||
}
|
||||
|
||||
if ((dsize = i2d(x, NULL)) < 0) {
|
||||
if ((dsize = i2d(x, NULL)) <= 0) {
|
||||
PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_ASN1_LIB);
|
||||
dsize = 0;
|
||||
goto err;
|
||||
|
@ -791,7 +791,7 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name,
|
|||
{
|
||||
BIO *tmp = *header;
|
||||
char *linebuf, *p;
|
||||
int len, line, ret = 0, end = 0;
|
||||
int len, line, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0;
|
||||
/* 0 if not seen (yet), 1 if reading header, 2 if finished header */
|
||||
enum header_status got_header = MAYBE_HEADER;
|
||||
unsigned int flags_mask;
|
||||
|
@ -809,10 +809,18 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name,
|
|||
flags_mask = ~0u;
|
||||
len = BIO_gets(bp, linebuf, LINESIZE);
|
||||
if (len <= 0) {
|
||||
PEMerr(PEM_F_GET_HEADER_AND_DATA, PEM_R_SHORT_HEADER);
|
||||
PEMerr(PEM_F_GET_HEADER_AND_DATA, PEM_R_BAD_END_LINE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if line has been read completely or if only part of the line
|
||||
* has been read. Keep the previous value to ignore newlines that
|
||||
* appear due to reading a line up until the char before the newline.
|
||||
*/
|
||||
prev_partial_line_read = partial_line_read;
|
||||
partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
|
||||
|
||||
if (got_header == MAYBE_HEADER) {
|
||||
if (memchr(linebuf, ':', len) != NULL)
|
||||
got_header = IN_HEADER;
|
||||
|
@ -823,13 +831,19 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name,
|
|||
|
||||
/* Check for end of header. */
|
||||
if (linebuf[0] == '\n') {
|
||||
if (got_header == POST_HEADER) {
|
||||
/* Another blank line is an error. */
|
||||
PEMerr(PEM_F_GET_HEADER_AND_DATA, PEM_R_BAD_END_LINE);
|
||||
goto err;
|
||||
/*
|
||||
* If previous line has been read only partially this newline is a
|
||||
* regular newline at the end of a line and not an empty line.
|
||||
*/
|
||||
if (!prev_partial_line_read) {
|
||||
if (got_header == POST_HEADER) {
|
||||
/* Another blank line is an error. */
|
||||
PEMerr(PEM_F_GET_HEADER_AND_DATA, PEM_R_BAD_END_LINE);
|
||||
goto err;
|
||||
}
|
||||
got_header = POST_HEADER;
|
||||
tmp = *data;
|
||||
}
|
||||
got_header = POST_HEADER;
|
||||
tmp = *data;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue