Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ber tag factory to parser to allow custom tag creation. #12

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

kullanici0606
Copy link
Contributor

Hi,

We are dealing with an errornous ber tlv data that is defined by GlobalPlatform.
GlobalPlatform used 'B0' and 'F0' tags for primitive tlv however since their contructed bit is set,
ber-tlv rightfully fails to parse them. Since Globalplatform decided to not to fix them, we need a way to handle these tags. I thought, if ber-tlv parser takes a tag factory, then we can write a custom tag factory to handle them. Therefore I added an interface and a default factory. Could you please review it and if it is OK for you, could you please add it to the project? Currently, there is no way to override the parsing behaviour.

This may help to cope with data that was designed errornously such as
GlobalPlatform public key data which has 'B0' and 'F0' tags which are
not valid. Explanation from document [1] - Table 3-8:
GlobalPlatform acknowledges as an error that values 'B0' and 'F0' in the table above are not
valid ASN.1 tag values. This mistake was introduced in previous versions of this specification.
Although this may be a problem for standard tools used to edit or display certificates and ASN.1
structures in general, it’s been decided, for the moment at least, to keep such values to preserve
backward compatibility with existing implementations already coping with such errors.

[1] https://globalplatform.org/wp-content/uploads/2019/07/GPC_2.3_A_ConfidentialCardContentMgmt_v1.2_PublicRelease-replacement.pdf

This may help to cope with data that was designed errornously such as
GlobalPlatform public key data which has 'B0' and 'F0' tags which are
not valid. Explanation from document [1] - Table 3-8:
GlobalPlatform acknowledges as an error that values 'B0' and 'F0' in the table above are not
valid ASN.1 tag values. This mistake was introduced in previous versions of this specification.
Although this may be a problem for standard tools used to edit or display certificates and ASN.1
structures in general, it’s been decided, for the moment at least, to keep such values to preserve
backward compatibility with existing implementations already coping with such errors.

[1] https://globalplatform.org/wp-content/uploads/2019/07/GPC_2.3_A_ConfidentialCardContentMgmt_v1.2_PublicRelease-replacement.pdf
@evsinev evsinev merged commit 1c8d392 into evsinev:master Oct 4, 2019
@evsinev
Copy link
Owner

evsinev commented Oct 4, 2019

Hi,

Thank you for your pull request.
It will also help us to fix #11 issue.

@kullanici0606
Copy link
Contributor Author

Thank you.

@nillsondg
Copy link

@evsinev Can you release new version. I look forward to this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants