Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
0199-asn1-fix-RELATIVE-OID-validation.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0199-asn1-fix-RELATIVE-OID-validation.patch of Package erlang
From ece603706f32778c63a2ffc3548703e75272dc77 Mon Sep 17 00:00:00 2001 From: montag451 <montag451@laposte.net> Date: Wed, 22 Mar 2023 12:41:26 +0100 Subject: [PATCH] asn1: fix RELATIVE-OID validation --- lib/asn1/src/asn1ct_check.erl | 4 ++-- lib/asn1/test/asn1_SUITE_data/ValueTest.asn | 4 ++++ lib/asn1/test/error_SUITE.erl | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index a6d9da9977..fc2657f0c3 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -1855,8 +1855,8 @@ validate_oid(S, OidType, [{'NamedNumber',_Name,Value}|Vrest], Acc) validate_oid(S, OidType, Vrest, [Value|Acc]); validate_oid(S, OidType, [#'Externalvaluereference'{}=Id|Vrest], Acc) -> NeededOidType = case Acc of - [] -> o_id; - [_|_] -> rel_oid + [] when OidType =:= o_id -> o_id; + _ -> rel_oid end, try get_oid_value(S, NeededOidType, true, Id) of Val when is_integer(Val) -> diff --git a/lib/asn1/test/asn1_SUITE_data/ValueTest.asn b/lib/asn1/test/asn1_SUITE_data/ValueTest.asn index 0474386061..39feddfffd 100644 --- a/lib/asn1/test/asn1_SUITE_data/ValueTest.asn +++ b/lib/asn1/test/asn1_SUITE_data/ValueTest.asn @@ -33,6 +33,10 @@ include-roid OBJECT IDENTIFIER ::= {0 rel-oid-1} include-oid OBJECT IDENTIFIER ::= {integer-first 1} include-all OBJECT IDENTIFIER ::= {integer-first 1 rel-oid-1 42} +-- RELATIVE-OID +rel-oid-2 RELATIVE-OID ::= {rel-oid-1 6} +rel-oid-3 RELATIVE-OID ::= {rel-oid-1 rel-oid-2 7} + --Character strings numericstring NumericString ::= "01234567" printablestring PrintableString ::= "PrintableString" diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl index 6ce77d93fb..cfec438e1b 100644 --- a/lib/asn1/test/error_SUITE.erl +++ b/lib/asn1/test/error_SUITE.erl @@ -478,6 +478,7 @@ rel_oids(Config) -> "wrong-type-rel-oid-5 RELATIVE-OID ::= object-1.&undef\n" "oid-bad-first OBJECT IDENTIFIER ::= {legal-roid 3}\n" + "roid-bad-first RELATIVE-OID ::= {legal-oid 3}\n" "END\n">>}, {error, [ @@ -486,7 +487,8 @@ rel_oids(Config) -> {structured_error,{M,14},asn1ct_check,{illegal_oid,rel_oid}}, {structured_error,{M,15},asn1ct_check,{illegal_oid,rel_oid}}, {structured_error,{M,16},asn1ct_check,{undefined_field,undef}}, - {structured_error,{M,17},asn1ct_check,{illegal_oid,o_id}} + {structured_error,{M,17},asn1ct_check,{illegal_oid,o_id}}, + {structured_error,{M,18},asn1ct_check,{illegal_oid,rel_oid}} ] } = run(P, Config), ok. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor