diff options
author | tb <> | 2022-05-13 16:32:10 +0000 |
---|---|---|
committer | tb <> | 2022-05-13 16:32:10 +0000 |
commit | b8ce4b4aa5f41896f606d7ca7e3d28dd8c564c95 (patch) | |
tree | 602d37b0dc783f37494f7c4e68d42305ad8fbfa6 | |
parent | abd206ca1723c68b18c82cbf0f3d612db7a96b9c (diff) | |
download | openbsd-b8ce4b4aa5f41896f606d7ca7e3d28dd8c564c95.tar.gz openbsd-b8ce4b4aa5f41896f606d7ca7e3d28dd8c564c95.tar.bz2 openbsd-b8ce4b4aa5f41896f606d7ca7e3d28dd8c564c95.zip |
Fix d2i_ASN1_OBJECT()
Due to a confusion of two CBS, the API would incorrectly advance the
*der_in pointer, resulting in a DER parse failure.
Issue reported by Aram Sargsyan
ok jsing
-rw-r--r-- | src/lib/libcrypto/asn1/a_object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c index c695499b31..2ee6c17dc6 100644 --- a/src/lib/libcrypto/asn1/a_object.c +++ b/src/lib/libcrypto/asn1/a_object.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_object.c,v 1.47 2022/04/23 18:47:08 jsing Exp $ */ | 1 | /* $OpenBSD: a_object.c,v 1.48 2022/05/13 16:32:10 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -656,7 +656,7 @@ d2i_ASN1_OBJECT(ASN1_OBJECT **out_aobj, const unsigned char **pp, long length) | |||
656 | if (!c2i_ASN1_OBJECT_cbs(&aobj, &content)) | 656 | if (!c2i_ASN1_OBJECT_cbs(&aobj, &content)) |
657 | return NULL; | 657 | return NULL; |
658 | 658 | ||
659 | *pp = CBS_data(&content); | 659 | *pp = CBS_data(&cbs); |
660 | 660 | ||
661 | if (out_aobj != NULL) | 661 | if (out_aobj != NULL) |
662 | *out_aobj = aobj; | 662 | *out_aobj = aobj; |