2
0

Prefix versions with V to fix a Swift enum naming import issue.

This commit is contained in:
Maarten Billemont 2019-10-10 11:48:35 -04:00
parent 2af71fbc34
commit aec5e371b8
7 changed files with 37 additions and 37 deletions

View File

@ -50,7 +50,7 @@ static NSOperationQueue *_mpwQueue = nil;
- (MPAlgorithmVersion)version {
return MPAlgorithmVersion0;
return MPAlgorithmVersionV0;
}
- (NSString *)description {

View File

@ -23,7 +23,7 @@
- (MPAlgorithmVersion)version {
return MPAlgorithmVersion1;
return MPAlgorithmVersionV1;
}
- (BOOL)tryMigrateSite:(MPSiteEntity *)site explicit:(BOOL)explicit {

View File

@ -23,7 +23,7 @@
- (MPAlgorithmVersion)version {
return MPAlgorithmVersion2;
return MPAlgorithmVersionV2;
}
- (BOOL)tryMigrateSite:(MPSiteEntity *)site explicit:(BOOL)explicit {

View File

@ -23,7 +23,7 @@
- (MPAlgorithmVersion)version {
return MPAlgorithmVersion3;
return MPAlgorithmVersionV3;
}
- (BOOL)tryMigrateSite:(MPSiteEntity *)site explicit:(BOOL)explicit {

View File

@ -136,7 +136,7 @@
return MPAlgorithmForVersion(
MIN( MPAlgorithmVersionCurrent,
MAX( MPAlgorithmVersion0, (MPAlgorithmVersion)[self.version_ unsignedIntegerValue] ) ) );
MAX( MPAlgorithmVersionV0, (MPAlgorithmVersion)[self.version_ unsignedIntegerValue] ) ) );
}
- (void)setAlgorithm:(id<MPAlgorithm>)algorithm {
@ -368,7 +368,7 @@
return MPAlgorithmForVersion(
MIN( MPAlgorithmVersionCurrent,
MAX( MPAlgorithmVersion0, (MPAlgorithmVersion)[self.version_ unsignedIntegerValue] ) ) );
MAX( MPAlgorithmVersionV0, (MPAlgorithmVersion)[self.version_ unsignedIntegerValue] ) ) );
}
- (void)setAlgorithm:(id<MPAlgorithm>)version {

View File

@ -47,13 +47,13 @@ const MPMasterKey mpw_master_key(const char *fullName, const char *masterPasswor
}
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_master_key_v0( fullName, masterPassword );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_master_key_v1( fullName, masterPassword );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_master_key_v2( fullName, masterPassword );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_master_key_v3( fullName, masterPassword );
default:
err( "Unsupported version: %d", algorithmVersion );
@ -83,13 +83,13 @@ const MPSiteKey mpw_site_key(
}
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_site_key_v0( masterKey, siteName, siteCounter, keyPurpose, keyContext );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_site_key_v1( masterKey, siteName, siteCounter, keyPurpose, keyContext );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_site_key_v2( masterKey, siteName, siteCounter, keyPurpose, keyContext );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_site_key_v3( masterKey, siteName, siteCounter, keyPurpose, keyContext );
default:
err( "Unsupported version: %d", algorithmVersion );
@ -125,13 +125,13 @@ const char *mpw_site_result(
char *sitePassword = NULL;
if (resultType & MPResultTypeClassTemplate) {
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_site_template_password_v0( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_site_template_password_v1( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_site_template_password_v2( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_site_template_password_v3( masterKey, siteKey, resultType, resultParam );
default:
err( "Unsupported version: %d", algorithmVersion );
@ -140,13 +140,13 @@ const char *mpw_site_result(
}
else if (resultType & MPResultTypeClassStateful) {
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_site_crypted_password_v0( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_site_crypted_password_v1( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_site_crypted_password_v2( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_site_crypted_password_v3( masterKey, siteKey, resultType, resultParam );
default:
err( "Unsupported version: %d", algorithmVersion );
@ -155,13 +155,13 @@ const char *mpw_site_result(
}
else if (resultType & MPResultTypeClassDerive) {
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_site_derived_password_v0( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_site_derived_password_v1( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_site_derived_password_v2( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_site_derived_password_v3( masterKey, siteKey, resultType, resultParam );
default:
err( "Unsupported version: %d", algorithmVersion );
@ -205,13 +205,13 @@ const char *mpw_site_state(
}
switch (algorithmVersion) {
case MPAlgorithmVersion0:
case MPAlgorithmVersionV0:
return mpw_site_state_v0( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion1:
case MPAlgorithmVersionV1:
return mpw_site_state_v1( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion2:
case MPAlgorithmVersionV2:
return mpw_site_state_v2( masterKey, siteKey, resultType, resultParam );
case MPAlgorithmVersion3:
case MPAlgorithmVersionV3:
return mpw_site_state_v3( masterKey, siteKey, resultType, resultParam );
default:
err( "Unsupported version: %d", algorithmVersion );

View File

@ -23,17 +23,17 @@
typedef mpw_enum( unsigned int, MPAlgorithmVersion ) {
/** V0 did math with chars whose signedness was platform-dependent. */
MPAlgorithmVersion0,
MPAlgorithmVersionV0,
/** V1 miscounted the byte-length of multi-byte site names. */
MPAlgorithmVersion1,
MPAlgorithmVersionV1,
/** V2 miscounted the byte-length of multi-byte user names. */
MPAlgorithmVersion2,
MPAlgorithmVersionV2,
/** V3 is the current version. */
MPAlgorithmVersion3,
MPAlgorithmVersionV3,
MPAlgorithmVersionCurrent = MPAlgorithmVersion3,
MPAlgorithmVersionFirst = MPAlgorithmVersion0,
MPAlgorithmVersionLast = MPAlgorithmVersion3,
MPAlgorithmVersionCurrent = MPAlgorithmVersionV3,
MPAlgorithmVersionFirst = MPAlgorithmVersionV0,
MPAlgorithmVersionLast = MPAlgorithmVersionV3,
};
/** Derive the master key for a user based on their name and master password.