File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
webauthn-server-core/src/main/java/com/yubico/webauthn/data Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ public class AuthenticatorAssertionResponse implements AuthenticatorResponse {
72
72
*/
73
73
private final ByteArray userHandle ;
74
74
75
+ // This overrides the default getter in AuthenticatorResponse which re-parses the authenticator
76
+ // data on every invocation. This "optimization" has no measurable impact on performance, but it
77
+ // seems rude to obviously waste cycles for nothing.
78
+ private final transient AuthenticatorData parsedAuthenticatorData ;
79
+
75
80
@ NonNull
76
81
@ Getter (onMethod = @ __ ({@ Override }))
77
82
private final transient CollectedClientData clientData ;
@@ -85,6 +90,7 @@ private AuthenticatorAssertionResponse(
85
90
@ JsonProperty ("userHandle" ) final ByteArray userHandle )
86
91
throws IOException , Base64UrlException {
87
92
this .authenticatorData = authenticatorData ;
93
+ this .parsedAuthenticatorData = new AuthenticatorData (authenticatorData );
88
94
this .clientDataJSON = clientDataJSON ;
89
95
this .signature = signature ;
90
96
this .userHandle = userHandle ;
Original file line number Diff line number Diff line change @@ -113,6 +113,14 @@ private AuthenticatorAttestationResponse(
113
113
this .clientData = new CollectedClientData (clientDataJSON );
114
114
}
115
115
116
+ // The default getter in AuthenticatorResponse re-parses the authenticator data on every
117
+ // invocation. This "optimization" override has no measurable impact on performance, but it seems
118
+ // rude to obviously waste cycles for nothing.
119
+ @ Override
120
+ public AuthenticatorData getParsedAuthenticatorData () {
121
+ return attestation .getAuthenticatorData ();
122
+ }
123
+
116
124
public static AuthenticatorAttestationResponseBuilder .MandatoryStages builder () {
117
125
return new AuthenticatorAttestationResponseBuilder .MandatoryStages ();
118
126
}
You can’t perform that action at this time.
0 commit comments