diff options
| author | tb <> | 2023-11-01 20:19:16 +0000 |
|---|---|---|
| committer | tb <> | 2023-11-01 20:19:16 +0000 |
| commit | 62ea29947263e0890bc7199abb27ec3945fb3f97 (patch) | |
| tree | 45ff80ed86515524125e580659460d63680a4943 /src | |
| parent | 9f4e5409ac6b584c51b51f1fe559dc8474ee3489 (diff) | |
| download | openbsd-62ea29947263e0890bc7199abb27ec3945fb3f97.tar.gz openbsd-62ea29947263e0890bc7199abb27ec3945fb3f97.tar.bz2 openbsd-62ea29947263e0890bc7199abb27ec3945fb3f97.zip | |
Split X509_ALGOR_set0_parameter() out of X509_ALGOR_set0()
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index d91efe9323..869625036a 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x_algor.c,v 1.32 2023/11/01 20:14:51 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.33 2023/11/01 20:19:16 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -158,12 +158,9 @@ X509_ALGOR_set0_obj(X509_ALGOR *alg, ASN1_OBJECT *aobj) | |||
| 158 | return 1; | 158 | return 1; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | int | 161 | static int |
| 162 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | 162 | X509_ALGOR_set0_parameter(X509_ALGOR *alg, int ptype, void *pval) |
| 163 | { | 163 | { |
| 164 | if (alg == NULL) | ||
| 165 | return 0; | ||
| 166 | |||
| 167 | if (ptype == V_ASN1_UNDEF) { | 164 | if (ptype == V_ASN1_UNDEF) { |
| 168 | ASN1_TYPE_free(alg->parameter); | 165 | ASN1_TYPE_free(alg->parameter); |
| 169 | alg->parameter = NULL; | 166 | alg->parameter = NULL; |
| @@ -176,6 +173,18 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | |||
| 176 | ASN1_TYPE_set(alg->parameter, ptype, pval); | 173 | ASN1_TYPE_set(alg->parameter, ptype, pval); |
| 177 | } | 174 | } |
| 178 | 175 | ||
| 176 | return 1; | ||
| 177 | } | ||
| 178 | |||
| 179 | int | ||
| 180 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | ||
| 181 | { | ||
| 182 | if (alg == NULL) | ||
| 183 | return 0; | ||
| 184 | |||
| 185 | if (!X509_ALGOR_set0_parameter(alg, ptype, pval)) | ||
| 186 | return 0; | ||
| 187 | |||
| 179 | if (!X509_ALGOR_set0_obj(alg, aobj)) | 188 | if (!X509_ALGOR_set0_obj(alg, aobj)) |
| 180 | return 0; | 189 | return 0; |
| 181 | 190 | ||
