Fix expiry when adding subkeys

This commit is contained in:
Dominik Schürmann 2014-08-16 12:28:49 +02:00
parent 474fc50b80
commit 4d698c896a
3 changed files with 5 additions and 6 deletions

View File

@ -168,9 +168,9 @@ public class CreateKeyFinalFragment extends Fragment {
Bundle data = new Bundle(); Bundle data = new Bundle();
SaveKeyringParcel parcel = new SaveKeyringParcel(); SaveKeyringParcel parcel = new SaveKeyringParcel();
parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.CERTIFY_OTHER, null)); parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.CERTIFY_OTHER, 0L));
parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.SIGN_DATA, null)); parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.SIGN_DATA, 0L));
parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, null)); parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, 0L));
String userId = KeyRing.createUserId(mName, mEmail, null); String userId = KeyRing.createUserId(mName, mEmail, null);
parcel.mAddUserIds.add(userId); parcel.mAddUserIds.add(userId);
parcel.mChangePrimaryUserId = userId; parcel.mChangePrimaryUserId = userId;

View File

@ -503,7 +503,6 @@ public class EditKeyFragment extends LoaderFragment implements
private void save(String passphrase) { private void save(String passphrase) {
Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel.toString()); Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel.toString());
// Message is received after importing is done in KeychainIntentService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler( KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
getActivity(), getActivity(),
getString(R.string.progress_saving), getString(R.string.progress_saving),

View File

@ -183,9 +183,9 @@ public class AddSubkeyDialogFragment extends DialogFragment {
flags |= KeyFlags.AUTHENTICATION; flags |= KeyFlags.AUTHENTICATION;
} }
Long expiry; long expiry;
if (mNoExpiryCheckBox.isChecked()) { if (mNoExpiryCheckBox.isChecked()) {
expiry = null; expiry = 0L;
} else { } else {
Calendar selectedCal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); Calendar selectedCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
//noinspection ResourceType //noinspection ResourceType