diff options
| author | jsing <> | 2022-04-27 17:56:13 +0000 |
|---|---|---|
| committer | jsing <> | 2022-04-27 17:56:13 +0000 |
| commit | 9f0b8cd5903fa3dac8a3cf2e4123c4f95634cde7 (patch) | |
| tree | 4b7f316c463d7c077b6a58b0172d564b0c73ffba /src | |
| parent | 69dc3c36a9de6d7539f333f0462a589798660582 (diff) | |
| download | openbsd-9f0b8cd5903fa3dac8a3cf2e4123c4f95634cde7.tar.gz openbsd-9f0b8cd5903fa3dac8a3cf2e4123c4f95634cde7.tar.bz2 openbsd-9f0b8cd5903fa3dac8a3cf2e4123c4f95634cde7.zip | |
Decode via c2i_ASN1_INTEGER_cbs() from asn1_ex_c2i().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_locl.h | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h index ae9445c382..4d4c7a348d 100644 --- a/src/lib/libcrypto/asn1/asn1_locl.h +++ b/src/lib/libcrypto/asn1/asn1_locl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1_locl.h,v 1.26 2022/04/26 20:00:18 jsing Exp $ */ | 1 | /* $OpenBSD: asn1_locl.h,v 1.27 2022/04/27 17:56:13 jsing 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 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -203,6 +203,8 @@ int asn1_tag2charwidth(int tag); | |||
| 203 | 203 | ||
| 204 | int c2i_ASN1_BIT_STRING_cbs(ASN1_BIT_STRING **out_abs, CBS *cbs); | 204 | int c2i_ASN1_BIT_STRING_cbs(ASN1_BIT_STRING **out_abs, CBS *cbs); |
| 205 | 205 | ||
| 206 | int c2i_ASN1_INTEGER_cbs(ASN1_INTEGER **out_aint, CBS *cbs); | ||
| 207 | |||
| 206 | int c2i_ASN1_OBJECT_cbs(ASN1_OBJECT **out_aobj, CBS *content); | 208 | int c2i_ASN1_OBJECT_cbs(ASN1_OBJECT **out_aobj, CBS *content); |
| 207 | int i2t_ASN1_OBJECT_internal(const ASN1_OBJECT *aobj, char *buf, int buf_len, | 209 | int i2t_ASN1_OBJECT_internal(const ASN1_OBJECT *aobj, char *buf, int buf_len, |
| 208 | int no_name); | 210 | int no_name); |
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index 3936ecba63..b88c5f2bc1 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tasn_dec.c,v 1.52 2022/04/27 17:28:34 jsing Exp $ */ | 1 | /* $OpenBSD: tasn_dec.c,v 1.53 2022/04/27 17:56:13 jsing 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 | */ |
| @@ -774,7 +774,6 @@ asn1_ex_c2i(ASN1_VALUE **pval, CBS *content, int utype, const ASN1_ITEM *it) | |||
| 774 | ASN1_TYPE *typ = NULL; | 774 | ASN1_TYPE *typ = NULL; |
| 775 | ASN1_INTEGER **tint; | 775 | ASN1_INTEGER **tint; |
| 776 | ASN1_BOOLEAN *tbool; | 776 | ASN1_BOOLEAN *tbool; |
| 777 | const uint8_t *p; | ||
| 778 | uint8_t u8val; | 777 | uint8_t u8val; |
| 779 | int ret = 0; | 778 | int ret = 0; |
| 780 | 779 | ||
| @@ -840,8 +839,7 @@ asn1_ex_c2i(ASN1_VALUE **pval, CBS *content, int utype, const ASN1_ITEM *it) | |||
| 840 | case V_ASN1_INTEGER: | 839 | case V_ASN1_INTEGER: |
| 841 | case V_ASN1_ENUMERATED: | 840 | case V_ASN1_ENUMERATED: |
| 842 | tint = (ASN1_INTEGER **)pval; | 841 | tint = (ASN1_INTEGER **)pval; |
| 843 | p = CBS_data(content); | 842 | if (!c2i_ASN1_INTEGER_cbs(tint, content)) |
| 844 | if (!c2i_ASN1_INTEGER(tint, &p, CBS_len(content))) | ||
| 845 | goto err; | 843 | goto err; |
| 846 | /* Fixup type to match the expected form */ | 844 | /* Fixup type to match the expected form */ |
| 847 | (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG); | 845 | (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG); |
