Update to OpenSSL 1.0.2.o
This commit is contained in:
@@ -312,13 +312,13 @@ void OBJ_NAME_do_all_sorted(int type,
|
||||
|
||||
d.type = type;
|
||||
d.names =
|
||||
OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
|
||||
OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof(*d.names));
|
||||
/* Really should return an error if !d.names...but its a void function! */
|
||||
if (d.names) {
|
||||
d.n = 0;
|
||||
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
|
||||
|
||||
qsort((void *)d.names, d.n, sizeof *d.names, do_all_sorted_cmp);
|
||||
qsort((void *)d.names, d.n, sizeof(*d.names), do_all_sorted_cmp);
|
||||
|
||||
for (n = 0; n < d.n; ++n)
|
||||
fn(d.names[n], arg);
|
||||
|
||||
@@ -305,9 +305,8 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
|
||||
for (i = ADDED_DATA; i <= ADDED_NID; i++)
|
||||
if (ao[i] != NULL)
|
||||
OPENSSL_free(ao[i]);
|
||||
if (o != NULL)
|
||||
OPENSSL_free(o);
|
||||
return (NID_undef);
|
||||
ASN1_OBJECT_free(o);
|
||||
return NID_undef;
|
||||
}
|
||||
|
||||
ASN1_OBJECT *OBJ_nid2obj(int n)
|
||||
@@ -591,7 +590,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)) {
|
||||
BUF_strlcpy(buf, tbuf, buf_len);
|
||||
@@ -725,6 +724,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)
|
||||
{
|
||||
MS_STATIC char buf[512];
|
||||
@@ -746,9 +749,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++;
|
||||
@@ -756,15 +759,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++;
|
||||
|
||||
Reference in New Issue
Block a user