Skip to content

Commit

Permalink
fix: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Oct 18, 2023
1 parent 12e8c80 commit ccfd4f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/android/src/key_description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } f
export const id_ce_keyDescription = "1.3.6.1.4.1.11129.2.1.17";

/**
* Implements ASN.1 structure for attestation package info.
* Implements ASN.1 enumeration for verified boot state.
*
* ```asn
* VerifiedBootState ::= ENUMERATED {
Expand Down Expand Up @@ -272,9 +272,9 @@ export enum Version {
KM2 = 1,
KM3 = 2,
KM4 = 3,
v4 = 4,
v100 = 100,
v200 = 200,
KM4_1 = 4,
keyMint1 = 100,
keyMint2 = 200,
}

/**
Expand All @@ -295,7 +295,7 @@ export enum Version {
*/
export class KeyDescription {
@AsnProp({ type: AsnPropTypes.Integer })
public attestationVersion: Version = Version.KM4;
public attestationVersion: number | Version = Version.KM4;

@AsnProp({ type: AsnPropTypes.Enumerated })
public attestationSecurityLevel: SecurityLevel = SecurityLevel.software;
Expand Down
2 changes: 1 addition & 1 deletion packages/android/src/nonstandard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class NonStandardAuthorizationList extends AsnArray<NonStandardAuthorizat
*/
export class NonStandardKeyDescription {
@AsnProp({ type: AsnPropTypes.Integer })
public attestationVersion: Version = Version.KM4;
public attestationVersion: number | Version = Version.KM4;

@AsnProp({ type: AsnPropTypes.Enumerated })
public attestationSecurityLevel: SecurityLevel = SecurityLevel.software;
Expand Down
2 changes: 1 addition & 1 deletion packages/android/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ context("Android", () => {
],
});
const kd = new android.KeyDescription({
attestationVersion: android.Version.v200,
attestationVersion: android.Version.keyMint2,
attestationSecurityLevel: android.SecurityLevel.software,
keymasterVersion: 1,
keymasterSecurityLevel: android.SecurityLevel.software,
Expand Down

0 comments on commit ccfd4f0

Please sign in to comment.