summaryrefslogtreecommitdiffstats
path: root/crypto/x509/v3_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/v3_pci.c')
-rw-r--r--crypto/x509/v3_pci.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/crypto/x509/v3_pci.c b/crypto/x509/v3_pci.c
index a931e01a9c..79fe76d042 100644
--- a/crypto/x509/v3_pci.c
+++ b/crypto/x509/v3_pci.c
@@ -112,6 +112,7 @@ static int process_pci_value(CONF_VALUE *val,
return 0;
}
} else if (strcmp(val->name, "policy") == 0) {
+ char *valp = val->value;
unsigned char *tmp_data = NULL;
long val_len;
@@ -124,9 +125,9 @@ static int process_pci_value(CONF_VALUE *val,
}
free_policy = 1;
}
- if (strncmp(val->value, "hex:", 4) == 0) {
+ if (CHECK_AND_SKIP_PREFIX(valp, "hex:")) {
unsigned char *tmp_data2 =
- OPENSSL_hexstr2buf(val->value + 4, &val_len);
+ OPENSSL_hexstr2buf(valp, &val_len);
if (!tmp_data2) {
X509V3_conf_err(val);
@@ -155,10 +156,10 @@ static int process_pci_value(CONF_VALUE *val,
goto err;
}
OPENSSL_free(tmp_data2);
- } else if (strncmp(val->value, "file:", 5) == 0) {
+ } else if (CHECK_AND_SKIP_PREFIX(valp, "file:")) {
unsigned char buf[2048];
int n;
- BIO *b = BIO_new_file(val->value + 5, "r");
+ BIO *b = BIO_new_file(valp, "r");
if (!b) {
ERR_raise(ERR_LIB_X509V3, ERR_R_BIO_LIB);
X509V3_conf_err(val);
@@ -194,8 +195,8 @@ static int process_pci_value(CONF_VALUE *val,
X509V3_conf_err(val);
goto err;
}
- } else if (strncmp(val->value, "text:", 5) == 0) {
- val_len = strlen(val->value + 5);
+ } else if (CHECK_AND_SKIP_PREFIX(valp, "text:")) {
+ val_len = strlen(valp);
tmp_data = OPENSSL_realloc((*policy)->data,
(*policy)->length + val_len + 1);
if (tmp_data) {