From 138be9d14c41ed8a092255ff3df167b86124abf1 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 5 Mar 2018 08:14:11 -0500 Subject: [PATCH] Respect the user's default type when creating new sites. --- core/c/mpw-types.h | 30 ++++++++++++------------ platform-independent/cli-c/cli/mpw-cli.c | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/c/mpw-types.h b/core/c/mpw-types.h index 2541ed60..347f625b 100644 --- a/core/c/mpw-types.h +++ b/core/c/mpw-types.h @@ -72,30 +72,30 @@ typedef mpw_enum( uint16_t, MPSiteFeature ) { // bit 0-3 | MPResultTypeClass | MPSiteFeature typedef mpw_enum( uint32_t, MPResultType ) { - /** pg^VMAUBk5x3p%HP%i4= */ + /** 16: pg^VMAUBk5x3p%HP%i4= */ MPResultTypeTemplateMaximum = 0x0 | MPResultTypeClassTemplate | 0x0, - /** BiroYena8:Kixa */ + /** 17: BiroYena8:Kixa */ MPResultTypeTemplateLong = 0x1 | MPResultTypeClassTemplate | 0x0, - /** BirSuj0- */ + /** 18: BirSuj0- */ MPResultTypeTemplateMedium = 0x2 | MPResultTypeClassTemplate | 0x0, - /** pO98MoD0 */ - MPResultTypeTemplateBasic = 0x4 | MPResultTypeClassTemplate | 0x0, - /** Bir8 */ + /** 19: Bir8 */ MPResultTypeTemplateShort = 0x3 | MPResultTypeClassTemplate | 0x0, - /** 2798 */ + /** 20: pO98MoD0 */ + MPResultTypeTemplateBasic = 0x4 | MPResultTypeClassTemplate | 0x0, + /** 21: 2798 */ MPResultTypeTemplatePIN = 0x5 | MPResultTypeClassTemplate | 0x0, - /** birsujano */ + /** 30: birsujano */ MPResultTypeTemplateName = 0xE | MPResultTypeClassTemplate | 0x0, - /** bir yennoquce fefi */ + /** 31: bir yennoquce fefi */ MPResultTypeTemplatePhrase = 0xF | MPResultTypeClassTemplate | 0x0, - /** Custom saved password. */ - MPResultTypeStatefulPersonal = 0x0 | MPResultTypeClassStateful | MPSiteFeatureExportContent, - /** Custom saved password that should not be exported from the device. */ - MPResultTypeStatefulDevice = 0x1 | MPResultTypeClassStateful | MPSiteFeatureDevicePrivate, + /** 1056: Custom saved password. */ + MPResultTypeStatefulPersonal = 0x0 | MPResultTypeClassStateful | MPSiteFeatureExportContent, + /** 2081: Custom saved password that should not be exported from the device. */ + MPResultTypeStatefulDevice = 0x1 | MPResultTypeClassStateful | MPSiteFeatureDevicePrivate, - /** Derive a unique binary key. */ - MPResultTypeDeriveKey = 0x0 | MPResultTypeClassDerive | MPSiteFeatureAlternative, + /** 4160: Derive a unique binary key. */ + MPResultTypeDeriveKey = 0x0 | MPResultTypeClassDerive | MPSiteFeatureAlternative, MPResultTypeDefault = MPResultTypeTemplateLong, }; diff --git a/platform-independent/cli-c/cli/mpw-cli.c b/platform-independent/cli-c/cli/mpw-cli.c index 3db296a3..3fe83560 100644 --- a/platform-independent/cli-c/cli/mpw-cli.c +++ b/platform-independent/cli-c/cli/mpw-cli.c @@ -541,7 +541,7 @@ void cli_site(Arguments __unused *args, Operation *operation) { // If no site from mpsites, create a new one. if (!operation->site) operation->site = mpw_marshal_site( - operation->user, operation->siteName, MPResultTypeDefault, MPCounterValueDefault, operation->user->algorithm ); + operation->user, operation->siteName, operation->user->defaultType, MPCounterValueDefault, operation->user->algorithm ); } void cli_question(Arguments __unused *args, Operation *operation) {