aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-03-08 01:44:06 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-03-08 01:46:30 +0100
commit30ca8637ff50a78a7f36b82d3deef577f2f1e792 (patch)
tree2ecb085a34b4ac53758551a299709c0812f474b4 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations
parent443feef27a30ee141750fae025c8b0f475034c7b (diff)
downloadopen-keychain-30ca8637ff50a78a7f36b82d3deef577f2f1e792.tar.gz
open-keychain-30ca8637ff50a78a7f36b82d3deef577f2f1e792.tar.bz2
open-keychain-30ca8637ff50a78a7f36b82d3deef577f2f1e792.zip
add support for certification of user attributes
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java24
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java4
2 files changed, 18 insertions, 10 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java
index 025f45f7f..2e9551826 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/CertifyOperation.java
@@ -101,18 +101,26 @@ public class CertifyOperation extends BaseOperation {
continue;
}
- if (action.mUserIds == null) {
- log.add(LogType.MSG_CRT_CERTIFY_ALL, 2,
- KeyFormattingUtils.convertKeyIdToHex(action.mMasterKeyId));
- } else {
- log.add(LogType.MSG_CRT_CERTIFY_SOME, 2, action.mUserIds.size(),
+ CanonicalizedPublicKeyRing publicRing =
+ mProviderHelper.getCanonicalizedPublicKeyRing(action.mMasterKeyId);
+
+ UncachedKeyRing certifiedKey = null;
+ if (action.mUserIds != null) {
+ log.add(LogType.MSG_CRT_CERTIFY_UIDS, 2, action.mUserIds.size(),
KeyFormattingUtils.convertKeyIdToHex(action.mMasterKeyId));
+
+ certifiedKey = certificationKey.certifyUserIds(
+ publicRing, action.mUserIds, null, null);
}
- CanonicalizedPublicKeyRing publicRing =
- mProviderHelper.getCanonicalizedPublicKeyRing(action.mMasterKeyId);
+ if (action.mUserAttributes != null) {
+ log.add(LogType.MSG_CRT_CERTIFY_UATS, 2, action.mUserAttributes.size(),
+ KeyFormattingUtils.convertKeyIdToHex(action.mMasterKeyId));
+
+ certifiedKey = certificationKey.certifyUserAttributes(
+ publicRing, action.mUserAttributes, null, null);
+ }
- UncachedKeyRing certifiedKey = certificationKey.certifyUserIds(publicRing, action.mUserIds, null, null);
if (certifiedKey == null) {
certifyError += 1;
log.add(LogType.MSG_CRT_WARN_CERT_FAILED, 3);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
index a96cec8cf..068e314d5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
@@ -691,8 +691,8 @@ public abstract class OperationResult implements Parcelable {
MSG_PSE_SYMMETRIC (LogLevel.INFO, R.string.msg_pse_symmetric),
MSG_CRT_CERTIFYING (LogLevel.DEBUG, R.string.msg_crt_certifying),
- MSG_CRT_CERTIFY_ALL (LogLevel.DEBUG, R.string.msg_crt_certify_all),
- MSG_CRT_CERTIFY_SOME (LogLevel.DEBUG, R.plurals.msg_crt_certify_some),
+ MSG_CRT_CERTIFY_UIDS (LogLevel.DEBUG, R.plurals.msg_crt_certify_uids),
+ MSG_CRT_CERTIFY_UATS (LogLevel.DEBUG, R.plurals.msg_crt_certify_uats),
MSG_CRT_ERROR_SELF (LogLevel.ERROR, R.string.msg_crt_error_self),
MSG_CRT_ERROR_MASTER_NOT_FOUND (LogLevel.ERROR, R.string.msg_crt_error_master_not_found),
MSG_CRT_ERROR_NOTHING (LogLevel.ERROR, R.string.msg_crt_error_nothing),