diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-09 12:29:43 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-09 12:29:43 +0200 |
commit | 57f72996e8e0db35e629ffd48f58cb5812f47788 (patch) | |
tree | 3e8d73a8171d8cc1bd5270eae332367f406a68fd /OpenKeychain/src | |
parent | 4378f8f871f6a47321352f90a59cfaad7f52279b (diff) | |
download | open-keychain-57f72996e8e0db35e629ffd48f58cb5812f47788.tar.gz open-keychain-57f72996e8e0db35e629ffd48f58cb5812f47788.tar.bz2 open-keychain-57f72996e8e0db35e629ffd48f58cb5812f47788.zip |
linked-ids: rename "cookie" to "token"
Diffstat (limited to 'OpenKeychain/src')
12 files changed, 43 insertions, 43 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/LinkedCookieResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/LinkedTokenResource.java index d09854583..7eec2a66a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/LinkedCookieResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/LinkedTokenResource.java @@ -31,7 +31,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public abstract class LinkedCookieResource extends LinkedResource { +public abstract class LinkedTokenResource extends LinkedResource { protected final URI mSubUri; protected final Set<String> mFlags; @@ -40,7 +40,7 @@ public abstract class LinkedCookieResource extends LinkedResource { public static Pattern magicPattern = Pattern.compile("\\[Verifying my (?:Open)?PGP key: openpgp4fpr:([a-zA-Z0-9]+)]"); - protected LinkedCookieResource(Set<String> flags, HashMap<String, String> params, URI uri) { + protected LinkedTokenResource(Set<String> flags, HashMap<String, String> params, URI uri) { mFlags = flags; mParams = params; mSubUri = uri; @@ -64,9 +64,9 @@ public abstract class LinkedCookieResource extends LinkedResource { KeyFormattingUtils.convertFingerprintToHex(fingerprint)); } - protected static LinkedCookieResource fromUri (URI uri) { + protected static LinkedTokenResource fromUri (URI uri) { - if (!"openpgpid+cookie".equals(uri.getScheme())) { + if (!"openpgpid+token".equals(uri.getScheme())) { Log.e(Constants.TAG, "unknown uri scheme in (suspected) linked id packet"); return null; } @@ -103,11 +103,11 @@ public abstract class LinkedCookieResource extends LinkedResource { } - protected static LinkedCookieResource findResourceType (Set<String> flags, + protected static LinkedTokenResource findResourceType (Set<String> flags, HashMap<String,String> params, URI subUri) { - LinkedCookieResource res; + LinkedTokenResource res; res = GenericHttpsResource.create(flags, params, subUri); if (res != null) { @@ -133,7 +133,7 @@ public abstract class LinkedCookieResource extends LinkedResource { public URI toUri () { StringBuilder b = new StringBuilder(); - b.append("openpgpid+cookie:"); + b.append("openpgpid+token:"); // add flags if (mFlags != null) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/RawLinkedIdentity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/RawLinkedIdentity.java index 0bdc1b280..5310322f1 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/RawLinkedIdentity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/RawLinkedIdentity.java @@ -42,7 +42,7 @@ public class RawLinkedIdentity { String uriStr = Strings.fromUTF8ByteArray(data); URI uri = URI.create(uriStr); - LinkedResource res = LinkedCookieResource.fromUri(uri); + LinkedResource res = LinkedTokenResource.fromUri(uri); if (res == null) { return new RawLinkedIdentity(uri); } @@ -55,7 +55,7 @@ public class RawLinkedIdentity { } } - public static RawLinkedIdentity fromResource (LinkedCookieResource res) { + public static RawLinkedIdentity fromResource (LinkedTokenResource res) { return new RawLinkedIdentity(res.toUri()); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/DnsResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/DnsResource.java index d63cafcc2..1e55b0fc3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/DnsResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/DnsResource.java @@ -6,7 +6,7 @@ import android.support.annotation.StringRes; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import java.net.URI; @@ -24,10 +24,10 @@ import de.measite.minidns.Record.CLASS; import de.measite.minidns.Record.TYPE; import de.measite.minidns.record.TXT; -public class DnsResource extends LinkedCookieResource { +public class DnsResource extends LinkedTokenResource { final static Pattern magicPattern = - Pattern.compile("openpgpid\\+cookie=([a-zA-Z0-9]+)(?:#|;)([a-zA-Z0-9]+)"); + Pattern.compile("openpgpid\\+token=([a-zA-Z0-9]+)(?:#|;)([a-zA-Z0-9]+)"); String mFqdn; CLASS mClass; @@ -44,7 +44,7 @@ public class DnsResource extends LinkedCookieResource { public static String generateText(byte[] fingerprint) { - return String.format("openpgpid+cookie=%s", + return String.format("openpgpid+token=%s", KeyFormattingUtils.convertFingerprintToHex(fingerprint)); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GenericHttpsResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GenericHttpsResource.java index 55f998952..05939a2db 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GenericHttpsResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GenericHttpsResource.java @@ -10,7 +10,7 @@ import org.apache.http.client.methods.HttpGet; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import java.io.IOException; @@ -19,17 +19,17 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Set; -public class GenericHttpsResource extends LinkedCookieResource { +public class GenericHttpsResource extends LinkedTokenResource { GenericHttpsResource(Set<String> flags, HashMap<String,String> params, URI uri) { super(flags, params, uri); } public static String generateText (Context context, byte[] fingerprint) { - String cookie = LinkedCookieResource.generate(fingerprint); + String token = LinkedTokenResource.generate(fingerprint); return String.format(context.getResources().getString(R.string.linked_id_generic_text), - cookie, "0x" + KeyFormattingUtils.convertFingerprintToHex(fingerprint).substring(24)); + token, "0x" + KeyFormattingUtils.convertFingerprintToHex(fingerprint).substring(24)); } @SuppressWarnings("deprecation") // HttpGet is deprecated diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java index 078328198..ef042d540 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/GithubResource.java @@ -14,7 +14,7 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.util.Log; import java.io.IOException; @@ -28,7 +28,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -public class GithubResource extends LinkedCookieResource { +public class GithubResource extends LinkedTokenResource { final String mHandle; final String mGistId; @@ -42,9 +42,9 @@ public class GithubResource extends LinkedCookieResource { } public static String generate(Context context, byte[] fingerprint) { - String cookie = LinkedCookieResource.generate(fingerprint); + String token = LinkedTokenResource.generate(fingerprint); - return String.format(context.getResources().getString(R.string.linked_id_github_text), cookie); + return String.format(context.getResources().getString(R.string.linked_id_github_text), token); } @SuppressWarnings("deprecation") // HttpGet is deprecated @@ -86,7 +86,7 @@ public class GithubResource extends LinkedCookieResource { // narrow the needle down to important part Matcher matcher = magicPattern.matcher(needle); if (!matcher.find()) { - throw new AssertionError("Needle must contain cookie pattern! This is a programming error, please report."); + throw new AssertionError("Needle must contain token pattern! This is a programming error, please report."); } needle = matcher.group(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/TwitterResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/TwitterResource.java index c981e2bd6..36100fe58 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/TwitterResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/linked/resources/TwitterResource.java @@ -19,7 +19,7 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import java.io.IOException; import java.net.MalformedURLException; @@ -30,7 +30,7 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class TwitterResource extends LinkedCookieResource { +public class TwitterResource extends LinkedTokenResource { final String mHandle; final String mTweetId; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java index e72366fe1..e0e6976ee 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java @@ -29,7 +29,7 @@ import android.widget.TextView; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.compatibility.ClipboardReflection; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.linked.resources.DnsResource; import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.ui.util.Notify.Style; @@ -104,7 +104,7 @@ public class LinkedIdCreateDnsStep2Fragment extends LinkedIdCreateFinalFragment } @Override - LinkedCookieResource getResource(OperationLog log) { + LinkedTokenResource getResource(OperationLog log) { return DnsResource.createNew(mResourceDomain); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java index 5b3250644..985cb6f18 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java @@ -20,7 +20,7 @@ import org.sufficientlysecure.keychain.operations.results.LinkedVerifyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.pgp.WrappedUserAttribute; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.linked.LinkedIdentity; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; @@ -39,7 +39,7 @@ public abstract class LinkedIdCreateFinalFragment extends CryptoOperationFragmen private ViewAnimator mVerifyAnimator; // This is a resource, set AFTER it has been verified - LinkedCookieResource mVerifiedResource = null; + LinkedTokenResource mVerifiedResource = null; private ViewAnimator mVerifyButtonAnimator; @Override @@ -94,7 +94,7 @@ public abstract class LinkedIdCreateFinalFragment extends CryptoOperationFragmen return view; } - abstract LinkedCookieResource getResource(OperationLog log); + abstract LinkedTokenResource getResource(OperationLog log); private void setVerifyProgress(boolean on, Boolean success) { if (success == null) { @@ -133,7 +133,7 @@ public abstract class LinkedIdCreateFinalFragment extends CryptoOperationFragmen long timer = System.currentTimeMillis(); OperationLog log = new OperationLog(); - LinkedCookieResource resource = getResource(log); + LinkedTokenResource resource = getResource(log); if (resource == null) { return new LinkedVerifyResult(LinkedVerifyResult.RESULT_ERROR, log); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateGithubStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateGithubStep2Fragment.java index 95c029738..6e85193a7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateGithubStep2Fragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateGithubStep2Fragment.java @@ -27,7 +27,7 @@ import android.view.ViewGroup; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.linked.resources.GithubResource; @@ -87,7 +87,7 @@ public class LinkedIdCreateGithubStep2Fragment extends LinkedIdCreateFinalFragme } @Override - LinkedCookieResource getResource(OperationLog log) { + LinkedTokenResource getResource(OperationLog log) { return GithubResource.searchInGithubStream(mResourceHandle, mResourceString, log); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java index ebfbfd16b..aa9354a04 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java @@ -29,7 +29,7 @@ import android.widget.TextView; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.linked.resources.TwitterResource; public class LinkedIdCreateTwitterStep2Fragment extends LinkedIdCreateFinalFragment { @@ -90,7 +90,7 @@ public class LinkedIdCreateTwitterStep2Fragment extends LinkedIdCreateFinalFragm } @Override - LinkedCookieResource getResource(OperationLog log) { + LinkedTokenResource getResource(OperationLog log) { return TwitterResource.searchInTwitterStream(mResourceHandle, mResourceString, log); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java index d2ae69a24..c3dcaf239 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java @@ -33,7 +33,7 @@ import org.sufficientlysecure.keychain.Constants.key; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.operations.results.LinkedVerifyResult; -import org.sufficientlysecure.keychain.linked.LinkedCookieResource; +import org.sufficientlysecure.keychain.linked.LinkedTokenResource; import org.sufficientlysecure.keychain.linked.LinkedIdentity; import org.sufficientlysecure.keychain.linked.LinkedResource; import org.sufficientlysecure.keychain.linked.RawLinkedIdentity; @@ -69,7 +69,7 @@ public class LinkedIdViewFragment extends CryptoOperationFragment implements private static final int LOADER_ID_LINKED_ID = 1; private RawLinkedIdentity mLinkedId; - private LinkedCookieResource mLinkedResource; + private LinkedTokenResource mLinkedResource; private boolean mIsSecret; private Context mContext; @@ -191,7 +191,7 @@ public class LinkedIdViewFragment extends CryptoOperationFragment implements if (mLinkedId instanceof LinkedIdentity) { LinkedResource res = ((LinkedIdentity) mLinkedId).mResource; - mLinkedResource = (LinkedCookieResource) res; + mLinkedResource = (LinkedTokenResource) res; } if (!mIsSecret) { diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 0df71b768..2c438370a 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -1177,11 +1177,11 @@ <item quantity="other">"Failed to delete %d keys"</item> </plurals> - <!-- Linked identity verification --> + <!-- Linked Identity verification --> <string name="msg_lv">"Verifying linked identity…"</string> - <string name="msg_lv_match">"Searching for cookie"</string> - <string name="msg_lv_match_error">"No cookie found in resource!"</string> - <string name="msg_lv_fp_ok">"Fingerprint ok."</string> + <string name="msg_lv_match">"Searching for token"</string> + <string name="msg_lv_match_error">"No token found in resource!"</string> + <string name="msg_lv_fp_ok">"Fingerprint OK."</string> <string name="msg_lv_fp_error">"Fingerprint mismatch!"</string> <string name="msg_lv_error_twitter_auth">"Error obtaining Twitter auth token!"</string> @@ -1366,8 +1366,8 @@ <string name="linked_select_1">"A \'linked identity\' connects your pgp key to a resource on the web."</string> <string name="linked_select_2">"Please select a type:"</string> - <string name="linked_id_generic_text">"This file claims ownership of the OpenPGP key with long id %2$s.\n\nCookie for proof:\n%1$s"</string> - <string name="linked_id_github_text">"This Gist confirms the Linked Identity in my OpenPGP key, and links it to this Github account.\n\nCookie for proof:\n%1$s"</string> + <string name="linked_id_generic_text">"This file claims ownership of the OpenPGP key with long id %2$s.\n\nToken for proof:\n%1$s"</string> + <string name="linked_id_github_text">"This Gist confirms the Linked Identity in my OpenPGP key, and links it to this Github account.\n\nToken for proof:\n%1$s"</string> <string name="linked_verifying">"Verifying…"</string> <string name="linked_verify_success">"Verified!"</string> <string name="linked_verify_error">"Verification error!"</string> |