From 6d0b5a2097940ed7cae8e5b68b7e3d47338c2133 Mon Sep 17 00:00:00 2001 From: z4yx Date: Tue, 21 May 2024 19:59:10 +0800 Subject: [PATCH] test openpgp Get Challenge --- test-via-pcsc/openpgp_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test-via-pcsc/openpgp_test.go b/test-via-pcsc/openpgp_test.go index 48533b93..09778dce 100644 --- a/test-via-pcsc/openpgp_test.go +++ b/test-via-pcsc/openpgp_test.go @@ -107,6 +107,13 @@ func TestOpenPGPApplet(t *testing.T) { So(res, ShouldResemble, []byte{2, 2, 0x05, 0x3C, 2, 2, 0x05, 0x3C}) // 1340 bytes }) + Convey("Get challenge", func(ctx C) { + res, code, err := app.Send([]byte{0x00, 0x84, 0x00, 0x00, 0x00, 0x05, 0x3C}) + So(err, ShouldBeNil) + So(code, ShouldEqual, 0x9000) + So(len(res), ShouldEqual, 0x53C) // 1340 bytes + }) + Convey("Admin PIN retry times", func(ctx C) { _, code, err := app.Send([]byte{0x00, 0x20, 0x00, 0x83}) So(err, ShouldBeNil)