mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-26 00:48:51 -05:00
Rename fingerPrint to fingerprint
This commit is contained in:
parent
73acb69208
commit
b8462de6e5
@ -247,7 +247,7 @@ public class HkpKeyServer extends KeyServer {
|
|||||||
// see http://bit.ly/1d4bxbk and http://bit.ly/1gD1wwr
|
// see http://bit.ly/1d4bxbk and http://bit.ly/1gD1wwr
|
||||||
String fingerprintOrKeyId = matcher.group(1);
|
String fingerprintOrKeyId = matcher.group(1);
|
||||||
if (fingerprintOrKeyId.length() > 16) {
|
if (fingerprintOrKeyId.length() > 16) {
|
||||||
entry.setFingerPrintHex(fingerprintOrKeyId.toLowerCase(Locale.US));
|
entry.setFingerprintHex(fingerprintOrKeyId.toLowerCase(Locale.US));
|
||||||
entry.setKeyIdHex("0x" + fingerprintOrKeyId.substring(fingerprintOrKeyId.length()
|
entry.setKeyIdHex("0x" + fingerprintOrKeyId.substring(fingerprintOrKeyId.length()
|
||||||
- 16, fingerprintOrKeyId.length()));
|
- 16, fingerprintOrKeyId.length()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,7 +45,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
public String keyIdHex;
|
public String keyIdHex;
|
||||||
public boolean revoked;
|
public boolean revoked;
|
||||||
public Date date; // TODO: not displayed
|
public Date date; // TODO: not displayed
|
||||||
public String fingerPrintHex;
|
public String fingerprintHex;
|
||||||
public int bitStrength;
|
public int bitStrength;
|
||||||
public String algorithm;
|
public String algorithm;
|
||||||
public boolean secretKey;
|
public boolean secretKey;
|
||||||
@ -67,7 +67,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
dest.writeLong(keyId);
|
dest.writeLong(keyId);
|
||||||
dest.writeByte((byte) (revoked ? 1 : 0));
|
dest.writeByte((byte) (revoked ? 1 : 0));
|
||||||
dest.writeSerializable(date);
|
dest.writeSerializable(date);
|
||||||
dest.writeString(fingerPrintHex);
|
dest.writeString(fingerprintHex);
|
||||||
dest.writeString(keyIdHex);
|
dest.writeString(keyIdHex);
|
||||||
dest.writeInt(bitStrength);
|
dest.writeInt(bitStrength);
|
||||||
dest.writeString(algorithm);
|
dest.writeString(algorithm);
|
||||||
@ -87,7 +87,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
vr.keyId = source.readLong();
|
vr.keyId = source.readLong();
|
||||||
vr.revoked = source.readByte() == 1;
|
vr.revoked = source.readByte() == 1;
|
||||||
vr.date = (Date) source.readSerializable();
|
vr.date = (Date) source.readSerializable();
|
||||||
vr.fingerPrintHex = source.readString();
|
vr.fingerprintHex = source.readString();
|
||||||
vr.keyIdHex = source.readString();
|
vr.keyIdHex = source.readString();
|
||||||
vr.bitStrength = source.readInt();
|
vr.bitStrength = source.readInt();
|
||||||
vr.algorithm = source.readString();
|
vr.algorithm = source.readString();
|
||||||
@ -153,12 +153,12 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFingerPrintHex() {
|
public String getFingerprintHex() {
|
||||||
return fingerPrintHex;
|
return fingerprintHex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFingerPrintHex(String fingerPrintHex) {
|
public void setFingerprintHex(String fingerprintHex) {
|
||||||
this.fingerPrintHex = fingerPrintHex;
|
this.fingerprintHex = fingerprintHex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBitStrength() {
|
public int getBitStrength() {
|
||||||
@ -271,7 +271,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
this.keyIdHex = PgpKeyHelper.convertKeyIdToHex(keyId);
|
this.keyIdHex = PgpKeyHelper.convertKeyIdToHex(keyId);
|
||||||
|
|
||||||
this.revoked = key.isRevoked();
|
this.revoked = key.isRevoked();
|
||||||
this.fingerPrintHex = PgpKeyHelper.convertFingerprintToHex(key.getFingerprint());
|
this.fingerprintHex = PgpKeyHelper.convertFingerprintToHex(key.getFingerprint());
|
||||||
this.bitStrength = key.getBitStrength();
|
this.bitStrength = key.getBitStrength();
|
||||||
final int algorithm = key.getAlgorithm();
|
final int algorithm = key.getAlgorithm();
|
||||||
this.algorithm = PgpKeyHelper.getAlgorithmInfo(context, algorithm);
|
this.algorithm = PgpKeyHelper.getAlgorithmInfo(context, algorithm);
|
||||||
|
@ -802,8 +802,8 @@ public class KeychainIntentService extends IntentService
|
|||||||
for (ImportKeysListEntry entry : entries) {
|
for (ImportKeysListEntry entry : entries) {
|
||||||
// if available use complete fingerprint for get request
|
// if available use complete fingerprint for get request
|
||||||
byte[] downloadedKeyBytes;
|
byte[] downloadedKeyBytes;
|
||||||
if (entry.getFingerPrintHex() != null) {
|
if (entry.getFingerprintHex() != null) {
|
||||||
downloadedKeyBytes = server.get("0x" + entry.getFingerPrintHex()).getBytes();
|
downloadedKeyBytes = server.get("0x" + entry.getFingerprintHex()).getBytes();
|
||||||
} else {
|
} else {
|
||||||
downloadedKeyBytes = server.get(entry.getKeyIdHex()).getBytes();
|
downloadedKeyBytes = server.get(entry.getKeyIdHex()).getBytes();
|
||||||
}
|
}
|
||||||
@ -829,10 +829,10 @@ public class KeychainIntentService extends IntentService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// verify downloaded key by comparing fingerprints
|
// verify downloaded key by comparing fingerprints
|
||||||
if (entry.getFingerPrintHex() != null) {
|
if (entry.getFingerprintHex() != null) {
|
||||||
String downloadedKeyFp = PgpKeyHelper.convertFingerprintToHex(
|
String downloadedKeyFp = PgpKeyHelper.convertFingerprintToHex(
|
||||||
downloadedKey.getPublicKey().getFingerprint());
|
downloadedKey.getPublicKey().getFingerprint());
|
||||||
if (downloadedKeyFp.equals(entry.getFingerPrintHex())) {
|
if (downloadedKeyFp.equals(entry.getFingerprintHex())) {
|
||||||
Log.d(Constants.TAG, "fingerprint of downloaded key is the same as " +
|
Log.d(Constants.TAG, "fingerprint of downloaded key is the same as " +
|
||||||
"the requested fingerprint!");
|
"the requested fingerprint!");
|
||||||
} else {
|
} else {
|
||||||
|
@ -146,9 +146,9 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
|||||||
|
|
||||||
holder.keyId.setText(entry.keyIdHex);
|
holder.keyId.setText(entry.keyIdHex);
|
||||||
|
|
||||||
if (entry.fingerPrintHex != null) {
|
if (entry.fingerprintHex != null) {
|
||||||
holder.fingerprint.setVisibility(View.VISIBLE);
|
holder.fingerprint.setVisibility(View.VISIBLE);
|
||||||
holder.fingerprint.setText(PgpKeyHelper.colorizeFingerprint(entry.fingerPrintHex));
|
holder.fingerprint.setText(PgpKeyHelper.colorizeFingerprint(entry.fingerprintHex));
|
||||||
} else {
|
} else {
|
||||||
holder.fingerprint.setVisibility(View.GONE);
|
holder.fingerprint.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ public class ImportKeysListServerLoader
|
|||||||
* set fingerprint explicitly after query
|
* set fingerprint explicitly after query
|
||||||
* to enforce a check when the key is imported by KeychainIntentService
|
* to enforce a check when the key is imported by KeychainIntentService
|
||||||
*/
|
*/
|
||||||
uniqueEntry.setFingerPrintHex(fingerprint);
|
uniqueEntry.setFingerprintHex(fingerprint);
|
||||||
uniqueEntry.setSelected(true);
|
uniqueEntry.setSelected(true);
|
||||||
mEntryList.add(uniqueEntry);
|
mEntryList.add(uniqueEntry);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user