Import OpenSSL 1.1.0h
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2018 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
|
||||
@@ -213,8 +213,8 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
|
||||
err:
|
||||
for (i = ADDED_DATA; i <= ADDED_NID; i++)
|
||||
OPENSSL_free(ao[i]);
|
||||
OPENSSL_free(o);
|
||||
return (NID_undef);
|
||||
ASN1_OBJECT_free(o);
|
||||
return NID_undef;
|
||||
}
|
||||
|
||||
ASN1_OBJECT *OBJ_nid2obj(int n)
|
||||
@@ -500,7 +500,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
|
||||
n += i;
|
||||
OPENSSL_free(bndec);
|
||||
} else {
|
||||
BIO_snprintf(tbuf, sizeof tbuf, ".%lu", l);
|
||||
BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
|
||||
i = strlen(tbuf);
|
||||
if (buf && (buf_len > 0)) {
|
||||
OPENSSL_strlcpy(buf, tbuf, buf_len);
|
||||
@@ -632,6 +632,10 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num,
|
||||
return (p);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse a BIO sink to create some extra oid's objects.
|
||||
* Line format:<OID:isdigit or '.']><isspace><SN><isspace><LN>
|
||||
*/
|
||||
int OBJ_create_objects(BIO *in)
|
||||
{
|
||||
char buf[512];
|
||||
@@ -653,9 +657,9 @@ int OBJ_create_objects(BIO *in)
|
||||
*(s++) = '\0';
|
||||
while (isspace((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == '\0')
|
||||
if (*s == '\0') {
|
||||
s = NULL;
|
||||
else {
|
||||
} else {
|
||||
l = s;
|
||||
while ((*l != '\0') && !isspace((unsigned char)*l))
|
||||
l++;
|
||||
@@ -663,15 +667,18 @@ int OBJ_create_objects(BIO *in)
|
||||
*(l++) = '\0';
|
||||
while (isspace((unsigned char)*l))
|
||||
l++;
|
||||
if (*l == '\0')
|
||||
if (*l == '\0') {
|
||||
l = NULL;
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
l = NULL;
|
||||
}
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
s = NULL;
|
||||
if ((o == NULL) || (*o == '\0'))
|
||||
return (num);
|
||||
}
|
||||
if (*o == '\0')
|
||||
return num;
|
||||
if (!OBJ_create(o, s, l))
|
||||
return (num);
|
||||
num++;
|
||||
@@ -685,7 +692,8 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
|
||||
int ok = 0;
|
||||
|
||||
/* Check to see if short or long name already present */
|
||||
if (OBJ_sn2nid(sn) != NID_undef || OBJ_ln2nid(ln) != NID_undef) {
|
||||
if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef)
|
||||
|| (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) {
|
||||
OBJerr(OBJ_F_OBJ_CREATE, OBJ_R_OID_EXISTS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user