}
PyTuple_SET_ITEM(t, 0, v);
- if (name->d.ip->length == 4) {
- unsigned char *p = name->d.ip->data;
+ if (ASN1_STRING_length(name->d.ip) == 4) {
+ const unsigned char *p = ASN1_STRING_get0_data(name->d.ip);
v = PyUnicode_FromFormat(
"%d.%d.%d.%d",
p[0], p[1], p[2], p[3]
);
- } else if (name->d.ip->length == 16) {
- unsigned char *p = name->d.ip->data;
+ } else if (ASN1_STRING_length(name->d.ip) == 16) {
+ const unsigned char *p = ASN1_STRING_get0_data(name->d.ip);
v = PyUnicode_FromFormat(
"%X:%X:%X:%X:%X:%X:%X:%X",
p[0] << 8 | p[1],
continue;
}
uri = ad->location->d.uniformResourceIdentifier;
- ostr = PyUnicode_FromStringAndSize((char *)uri->data,
- uri->length);
+ ostr = PyUnicode_FromStringAndSize(
+ (const char *)ASN1_STRING_get0_data(uri),
+ ASN1_STRING_length(uri));
if (ostr == NULL) {
goto fail;
}
continue;
}
uri = gn->d.uniformResourceIdentifier;
- ouri = PyUnicode_FromStringAndSize((char *)uri->data,
- uri->length);
+ ouri = PyUnicode_FromStringAndSize(
+ (const char *)ASN1_STRING_get0_data(uri),
+ ASN1_STRING_length(uri));
if (ouri == NULL)
goto done;