@@ -53,7 +53,7 @@ public FidoU2f()
53
53
}
54
54
55
55
[ Fact ]
56
- public async void TestU2f ( )
56
+ public async Task TestU2f ( )
57
57
{
58
58
var res = await MakeAttestationResponseAsync ( ) ;
59
59
Assert . Equal ( string . Empty , res . ErrorMessage ) ;
@@ -74,54 +74,54 @@ public async void TestU2f()
74
74
public async Task TestU2fWithAaguid ( )
75
75
{
76
76
_aaguid = new Guid ( "F1D0F1D0-F1D0-F1D0-F1D0-F1D0F1D0F1D0" ) ;
77
- var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
77
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
78
78
79
79
Assert . Equal ( Fido2ErrorCode . InvalidAttestation , ex . Code ) ;
80
80
Assert . Equal ( "Aaguid was not empty parsing fido-u2f attestation statement" , ex . Message ) ;
81
81
}
82
82
83
83
[ Fact ]
84
- public void TestU2fMissingX5c ( )
84
+ public async Task TestU2fMissingX5c ( )
85
85
{
86
86
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "x5c" , CborNull . Instance ) ;
87
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
88
- Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Result . Message ) ;
87
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
88
+ Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Message ) ;
89
89
}
90
90
91
91
[ Fact ]
92
- public void TestU2fX5cNotArray ( )
92
+ public async Task TestU2fX5cNotArray ( )
93
93
{
94
94
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "x5c" , new CborTextString ( "boomerang" ) ) ;
95
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
96
- Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Result . Message ) ;
95
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
96
+ Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Message ) ;
97
97
}
98
98
99
99
[ Fact ]
100
- public void TestU2fX5cCountNotOne ( )
100
+ public async Task TestU2fX5cCountNotOne ( )
101
101
{
102
102
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "x5c" , new CborArray { new byte [ 0 ] , new byte [ 0 ] } ) ;
103
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
104
- Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Result . Message ) ;
103
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
104
+ Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Message ) ;
105
105
}
106
106
107
107
[ Fact ]
108
- public void TestU2fX5cValueNotByteString ( )
108
+ public async Task TestU2fX5cValueNotByteString ( )
109
109
{
110
110
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "x5c" , new CborTextString ( "x" ) ) ;
111
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
112
- Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Result . Message ) ;
111
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
112
+ Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Message ) ;
113
113
}
114
114
115
115
[ Fact ]
116
- public void TestU2fX5cValueZeroLengthByteString ( )
116
+ public async Task TestU2fX5cValueZeroLengthByteString ( )
117
117
{
118
118
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "x5c" , new CborArray { new byte [ 0 ] } ) ;
119
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
120
- Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Result . Message ) ;
119
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
120
+ Assert . Equal ( "Malformed x5c in fido-u2f attestation" , ex . Message ) ;
121
121
}
122
122
123
123
[ Fact ]
124
- public void TestU2fAttCertNotP256 ( )
124
+ public async Task TestU2fAttCertNotP256 ( )
125
125
{
126
126
using ( var ecdsaAtt = ECDsa . Create ( ECCurve . NamedCurves . nistP384 ) )
127
127
{
@@ -135,46 +135,46 @@ public void TestU2fAttCertNotP256()
135
135
attnStmt . Set ( "x5c" , new CborArray { attestnCert . RawData } ) ;
136
136
}
137
137
138
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
139
- Assert . Equal ( "Attestation certificate public key is not an Elliptic Curve (EC) public key over the P-256 curve" , ex . Result . Message ) ;
138
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
139
+ Assert . Equal ( "Attestation certificate public key is not an Elliptic Curve (EC) public key over the P-256 curve" , ex . Message ) ;
140
140
}
141
141
142
142
[ Fact ]
143
- public void TestU2fSigNull ( )
143
+ public async Task TestU2fSigNull ( )
144
144
{
145
145
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "sig" , CborNull . Instance ) ;
146
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
147
- Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Result . Message ) ;
146
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
147
+ Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Message ) ;
148
148
}
149
149
[ Fact ]
150
- public void TestU2fSigNotByteString ( )
150
+ public async Task TestU2fSigNotByteString ( )
151
151
{
152
152
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "sig" , new CborTextString ( "walrus" ) ) ;
153
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
154
- Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Result . Message ) ;
153
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
154
+ Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Message ) ;
155
155
}
156
156
[ Fact ]
157
- public void TestU2fSigByteStringZeroLen ( )
157
+ public async Task TestU2fSigByteStringZeroLen ( )
158
158
{
159
159
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "sig" , new CborByteString ( new byte [ 0 ] ) ) ;
160
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
161
- Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Result . Message ) ;
160
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
161
+ Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Message ) ;
162
162
}
163
163
[ Fact ]
164
- public void TestU2fSigNotASN1 ( )
164
+ public async Task TestU2fSigNotASN1 ( )
165
165
{
166
166
( ( CborMap ) _attestationObject [ "attStmt" ] ) . Set ( "sig" , new CborByteString ( new byte [ ] { 0xf1 , 0xd0 } ) ) ;
167
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
168
- Assert . Equal ( "Failed to decode fido-u2f attestation signature from ASN.1 encoded form" , ex . Result . Message ) ;
167
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
168
+ Assert . Equal ( "Failed to decode fido-u2f attestation signature from ASN.1 encoded form" , ex . Message ) ;
169
169
}
170
170
[ Fact ]
171
- public void TestU2fBadSig ( )
171
+ public async Task TestU2fBadSig ( )
172
172
{
173
173
var attnStmt = ( CborMap ) _attestationObject [ "attStmt" ] ;
174
174
var sig = ( byte [ ] ) attnStmt [ "sig" ] ;
175
175
sig [ ^ 1 ] ^= 0xff ;
176
176
attnStmt . Set ( "sig" , new CborByteString ( sig ) ) ;
177
- var ex = Assert . ThrowsAsync < Fido2VerificationException > ( ( ) => MakeAttestationResponseAsync ( ) ) ;
178
- Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Result . Message ) ;
177
+ var ex = await Assert . ThrowsAsync < Fido2VerificationException > ( MakeAttestationResponseAsync ) ;
178
+ Assert . Equal ( "Invalid fido-u2f attestation signature" , ex . Message ) ;
179
179
}
180
180
}
0 commit comments