Skip to content

Commit 78a7c0c

Browse files
committed
Merge branch 'jens/fido-min-pin-length'
2 parents 23773c7 + d3fa8f3 commit 78a7c0c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

YubiKit/YubiKit/Connections/Shared/Requests/FIDO2/YKFFIDO2GetInfoResponse.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ extern NSString* const YKFFIDO2GetInfoResponseOptionUserVerification;
144144
*/
145145
@property (nonatomic, readonly, nullable) NSArray *pinProtocols;
146146

147+
/*!
148+
@abstract
149+
The current minimum PIN length, in Unicode code points, the authenticator enforces for ClientPIN.
150+
*/
151+
@property (nonatomic, readonly) NSUInteger minPinLength;
152+
147153
/*
148154
Not available: the response will be created by the library.
149155
*/

YubiKit/YubiKit/Connections/Shared/Requests/FIDO2/YKFFIDO2GetInfoResponse.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ typedef NS_ENUM(NSUInteger, YKFFIDO2GetInfoResponseKey) {
2929
YKFFIDO2GetInfoResponseKeyAAGUID = 0x03,
3030
YKFFIDO2GetInfoResponseKeyOptions = 0x04,
3131
YKFFIDO2GetInfoResponseKeyMaxMsgSize = 0x05,
32-
YKFFIDO2GetInfoResponseKeyPinProtocols = 0x06
32+
YKFFIDO2GetInfoResponseKeyPinProtocols = 0x06,
33+
YKFFIDO2GetInfoResponseKeyMinPinLength = 0x0d
34+
3335
};
3436

3537
@interface YKFFIDO2GetInfoResponse()
@@ -39,6 +41,7 @@ @interface YKFFIDO2GetInfoResponse()
3941
@property (nonatomic, readwrite) NSData *aaguid;
4042
@property (nonatomic, readwrite) NSDictionary *options;
4143
@property (nonatomic, assign, readwrite) NSUInteger maxMsgSize;
44+
@property (nonatomic, readwrite) NSUInteger minPinLength;
4245
@property (nonatomic, readwrite) NSArray *pinProtocols;
4346

4447
@end
@@ -95,6 +98,14 @@ - (BOOL)parseResponseMap:(YKFCBORMap *)map {
9598
self.maxMsgSize = maxMsgSize.integerValue;
9699
}
97100

101+
// minPinLength
102+
NSNumber *minPinLength = response[@(YKFFIDO2GetInfoResponseKeyMinPinLength)];
103+
if (minPinLength != nil) {
104+
self.minPinLength = minPinLength.integerValue;
105+
} else {
106+
self.minPinLength = 4;
107+
}
108+
98109
// pin protocols
99110
self.pinProtocols = response[@(YKFFIDO2GetInfoResponseKeyPinProtocols)];
100111

0 commit comments

Comments
 (0)