Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cktap-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ pub enum ChangeError {
err: CkTapError,
},
#[error("new cvc is too short, must be at least 6 bytes, was only {len} bytes")]
TooShort { len: u8 },
TooShort { len: u32 },
#[error("new cvc is too long, must be at most 32 bytes, was {len} bytes")]
TooLong { len: u8 },
TooLong { len: u32 },
#[error("new cvc is the same as the old one")]
SameAsOld,
}
Expand Down
12 changes: 6 additions & 6 deletions cktap-swift/Sources/CKTap/cktap_ffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2019,9 +2019,9 @@ enum ChangeError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {

case CkTap(err: CkTapError
)
case TooShort(len: UInt8
case TooShort(len: UInt32
)
case TooLong(len: UInt8
case TooLong(len: UInt32
)
case SameAsOld

Expand Down Expand Up @@ -2057,10 +2057,10 @@ public struct FfiConverterTypeChangeError: FfiConverterRustBuffer {
err: try FfiConverterTypeCkTapError.read(from: &buf)
)
case 2: return .TooShort(
len: try FfiConverterUInt8.read(from: &buf)
len: try FfiConverterUInt32.read(from: &buf)
)
case 3: return .TooLong(
len: try FfiConverterUInt8.read(from: &buf)
len: try FfiConverterUInt32.read(from: &buf)
)
case 4: return .SameAsOld

Expand All @@ -2082,12 +2082,12 @@ public struct FfiConverterTypeChangeError: FfiConverterRustBuffer {

case let .TooShort(len):
writeInt(&buf, Int32(2))
FfiConverterUInt8.write(len, into: &buf)
FfiConverterUInt32.write(len, into: &buf)


case let .TooLong(len):
writeInt(&buf, Int32(3))
FfiConverterUInt8.write(len, into: &buf)
FfiConverterUInt32.write(len, into: &buf)


case .SameAsOld:
Expand Down
4 changes: 2 additions & 2 deletions lib/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ pub enum ChangeError {
#[error(transparent)]
CkTap(#[from] CkTapError),
#[error("new cvc is too short, must be at least 6 bytes, was only {0} bytes")]
TooShort(u8),
TooShort(u32),
#[error("new cvc is too long, must be at most 32 bytes, was {0} bytes")]
TooLong(u8),
TooLong(u32),
#[error("new cvc is the same as the old one")]
SameAsOld,
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/tap_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ pub trait TapSignerShared: Authentication {
/// Change the CVC used for card authentication to a new user provided one
async fn change(&mut self, new_cvc: &str, cvc: &str) -> Result<(), ChangeError> {
if new_cvc.len() < 6 {
return Err(ChangeError::TooShort(new_cvc.len() as u8));
return Err(ChangeError::TooShort(new_cvc.len() as u32));
}

if new_cvc.len() > 32 {
return Err(ChangeError::TooLong(new_cvc.len() as u8));
return Err(ChangeError::TooLong(new_cvc.len() as u32));
}

if new_cvc == cvc {
Expand Down
Loading