From 9b1423ed3b383b2196ede7a62450a2e48b05ddbb Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 23 May 2024 01:40:23 +0000 Subject: [PATCH] x509_v3.c: mechanically replace ex with ext and new_ex with new_ext --- lib/libcrypto/x509/x509_v3.c | 84 ++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/lib/libcrypto/x509/x509_v3.c b/lib/libcrypto/x509/x509_v3.c index 3dee31e195e..4321c09c19f 100644 --- a/lib/libcrypto/x509/x509_v3.c +++ b/lib/libcrypto/x509/x509_v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_v3.c,v 1.22 2024/05/16 13:19:09 tb Exp $ */ +/* $OpenBSD: x509_v3.c,v 1.23 2024/05/23 01:40:23 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -94,7 +94,7 @@ X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, const ASN1_OBJECT *obj, int lastpos) { int n; - X509_EXTENSION *ex; + X509_EXTENSION *ext; if (sk == NULL) return -1; @@ -103,8 +103,8 @@ X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, lastpos = 0; n = sk_X509_EXTENSION_num(sk); for (; lastpos < n; lastpos++) { - ex = sk_X509_EXTENSION_value(sk, lastpos); - if (OBJ_cmp(ex->object, obj) == 0) + ext = sk_X509_EXTENSION_value(sk, lastpos); + if (OBJ_cmp(ext->object, obj) == 0) return lastpos; } return -1; @@ -116,7 +116,7 @@ X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, int lastpos) { int n; - X509_EXTENSION *ex; + X509_EXTENSION *ext; if (sk == NULL) return -1; @@ -125,9 +125,9 @@ X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, lastpos = 0; n = sk_X509_EXTENSION_num(sk); for (; lastpos < n; lastpos++) { - ex = sk_X509_EXTENSION_value(sk, lastpos); - if ((ex->critical > 0 && crit) || - (ex->critical <= 0 && !crit)) + ext = sk_X509_EXTENSION_value(sk, lastpos); + if ((ext->critical > 0 && crit) || + (ext->critical <= 0 && !crit)) return lastpos; } return -1; @@ -157,9 +157,9 @@ X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc) LCRYPTO_ALIAS(X509v3_delete_ext); STACK_OF(X509_EXTENSION) * -X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc) +X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ext, int loc) { - X509_EXTENSION *new_ex = NULL; + X509_EXTENSION *new_ext = NULL; int n; STACK_OF(X509_EXTENSION) *sk = NULL; @@ -180,9 +180,9 @@ X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc) else if (loc < 0) loc = n; - if ((new_ex = X509_EXTENSION_dup(ex)) == NULL) + if ((new_ext = X509_EXTENSION_dup(ext)) == NULL) goto err2; - if (!sk_X509_EXTENSION_insert(sk, new_ex, loc)) + if (!sk_X509_EXTENSION_insert(sk, new_ext, loc)) goto err; if (*x == NULL) *x = sk; @@ -191,8 +191,8 @@ X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc) err: X509error(ERR_R_MALLOC_FAILURE); err2: - if (new_ex != NULL) - X509_EXTENSION_free(new_ex); + if (new_ext != NULL) + X509_EXTENSION_free(new_ext); if (sk != NULL && x != NULL && sk != *x) sk_X509_EXTENSION_free(sk); return NULL; @@ -200,7 +200,7 @@ err2: LCRYPTO_ALIAS(X509v3_add_ext); X509_EXTENSION * -X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, +X509_EXTENSION_create_by_NID(X509_EXTENSION **ext, int nid, int crit, ASN1_OCTET_STRING *data) { ASN1_OBJECT *obj; @@ -211,7 +211,7 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, X509error(X509_R_UNKNOWN_NID); return NULL; } - ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); + ret = X509_EXTENSION_create_by_OBJ(ext, obj, crit, data); if (ret == NULL) ASN1_OBJECT_free(obj); return ret; @@ -219,18 +219,18 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, LCRYPTO_ALIAS(X509_EXTENSION_create_by_NID); X509_EXTENSION * -X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj, +X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ext, const ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data) { X509_EXTENSION *ret; - if (ex == NULL || *ex == NULL) { + if (ext == NULL || *ext == NULL) { if ((ret = X509_EXTENSION_new()) == NULL) { X509error(ERR_R_MALLOC_FAILURE); return NULL; } } else - ret= *ex; + ret= *ext; if (!X509_EXTENSION_set_object(ret, obj)) goto err; @@ -239,46 +239,46 @@ X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj, if (!X509_EXTENSION_set_data(ret, data)) goto err; - if (ex != NULL && *ex == NULL) - *ex = ret; + if (ext != NULL && *ext == NULL) + *ext = ret; return ret; err: - if (ex == NULL || ret != *ex) + if (ext == NULL || ret != *ext) X509_EXTENSION_free(ret); return NULL; } LCRYPTO_ALIAS(X509_EXTENSION_create_by_OBJ); int -X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj) +X509_EXTENSION_set_object(X509_EXTENSION *ext, const ASN1_OBJECT *obj) { - if (ex == NULL || obj == NULL) + if (ext == NULL || obj == NULL) return 0; - ASN1_OBJECT_free(ex->object); - ex->object = OBJ_dup(obj); - return ex->object != NULL; + ASN1_OBJECT_free(ext->object); + ext->object = OBJ_dup(obj); + return ext->object != NULL; } LCRYPTO_ALIAS(X509_EXTENSION_set_object); int -X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) +X509_EXTENSION_set_critical(X509_EXTENSION *ext, int crit) { - if (ex == NULL) + if (ext == NULL) return 0; - ex->critical = crit ? 0xFF : -1; + ext->critical = crit ? 0xFF : -1; return 1; } LCRYPTO_ALIAS(X509_EXTENSION_set_critical); int -X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) +X509_EXTENSION_set_data(X509_EXTENSION *ext, ASN1_OCTET_STRING *data) { int i; - if (ex == NULL) + if (ext == NULL) return 0; - i = ASN1_STRING_set(ex->value, data->data, data->length); + i = ASN1_STRING_set(ext->value, data->data, data->length); if (!i) return 0; return 1; @@ -286,29 +286,29 @@ X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) LCRYPTO_ALIAS(X509_EXTENSION_set_data); ASN1_OBJECT * -X509_EXTENSION_get_object(X509_EXTENSION *ex) +X509_EXTENSION_get_object(X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return NULL; - return ex->object; + return ext->object; } LCRYPTO_ALIAS(X509_EXTENSION_get_object); ASN1_OCTET_STRING * -X509_EXTENSION_get_data(X509_EXTENSION *ex) +X509_EXTENSION_get_data(X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return NULL; - return ex->value; + return ext->value; } LCRYPTO_ALIAS(X509_EXTENSION_get_data); int -X509_EXTENSION_get_critical(const X509_EXTENSION *ex) +X509_EXTENSION_get_critical(const X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return 0; - if (ex->critical > 0) + if (ext->critical > 0) return 1; return 0; } -- 2.20.1