2
0

Harmonize C/Java code more, WIP crypt/derive in Java.

This commit is contained in:
Maarten Billemont
2017-09-19 14:52:43 -04:00
parent 473e3ca11f
commit ad00ceb4ce
16 changed files with 207 additions and 73 deletions

View File

@@ -14,7 +14,6 @@ import org.joda.time.Instant;
*/
public class MPSite {
public static final MPResultType DEFAULT_TYPE = MPResultType.GeneratedLong;
public static final UnsignedInteger DEFAULT_COUNTER = UnsignedInteger.valueOf( 1 );
private final MPUser user;
@@ -27,7 +26,7 @@ public class MPSite {
private String loginName;
public MPSite(final MPUser user, final String siteName) {
this( user, siteName, DEFAULT_COUNTER, DEFAULT_TYPE );
this( user, siteName, DEFAULT_COUNTER, MPResultType.DEFAULT );
}
public MPSite(final MPUser user, final String siteName, final UnsignedInteger siteCounter, final MPResultType resultType) {
@@ -53,7 +52,7 @@ public class MPSite {
}
public String resultFor(final MasterKey masterKey) {
return resultFor( masterKey, MPKeyPurpose.Password, null );
return resultFor( masterKey, MPKeyPurpose.Authentication, null );
}
public String resultFor(final MasterKey masterKey, final MPKeyPurpose purpose, @Nullable final String context) {

View File

@@ -58,7 +58,7 @@ public class MPSiteUnmarshaller {
String fullName = null;
int mpVersion = 0, importFormat = 0, avatar = 0;
boolean clearContent = false, headerStarted = false;
MPResultType defaultType = MPResultType.GeneratedLong;
MPResultType defaultType = MPResultType.DEFAULT;
MPSiteUnmarshaller marshaller = null;
final ImmutableList.Builder<MPSite> sites = ImmutableList.builder();

View File

@@ -33,7 +33,7 @@ public class MPUser implements Comparable<MPUser> {
}
public MPUser(final String fullName, @Nullable final byte[] keyID) {
this( fullName, keyID, MasterKey.Version.CURRENT, 0, MPResultType.GeneratedLong, new DateTime() );
this( fullName, keyID, MasterKey.Version.CURRENT, 0, MPResultType.DEFAULT, new DateTime() );
}
public MPUser(final String fullName, @Nullable final byte[] keyID, final MasterKey.Version algorithmVersion, final int avatar,