Merge "Key rotation support when updating an app on IncFS." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
befe7710e1
@@ -198,6 +198,7 @@ public class ApkSignatureVerifier {
|
|||||||
ApkSignatureSchemeV4Verifier.extractCertificates(apkPath);
|
ApkSignatureSchemeV4Verifier.extractCertificates(apkPath);
|
||||||
Certificate[][] signerCerts = new Certificate[][]{vSigner.certs};
|
Certificate[][] signerCerts = new Certificate[][]{vSigner.certs};
|
||||||
Signature[] signerSigs = convertToSignatures(signerCerts);
|
Signature[] signerSigs = convertToSignatures(signerCerts);
|
||||||
|
Signature[] pastSignerSigs = null;
|
||||||
|
|
||||||
if (verifyFull) {
|
if (verifyFull) {
|
||||||
Map<Integer, byte[]> nonstreamingDigests;
|
Map<Integer, byte[]> nonstreamingDigests;
|
||||||
@@ -210,6 +211,15 @@ public class ApkSignatureVerifier {
|
|||||||
ApkSignatureSchemeV3Verifier.unsafeGetCertsWithoutVerification(apkPath);
|
ApkSignatureSchemeV3Verifier.unsafeGetCertsWithoutVerification(apkPath);
|
||||||
nonstreamingDigests = v3Signer.contentDigests;
|
nonstreamingDigests = v3Signer.contentDigests;
|
||||||
nonstreamingCerts = new Certificate[][]{v3Signer.certs};
|
nonstreamingCerts = new Certificate[][]{v3Signer.certs};
|
||||||
|
if (v3Signer.por != null) {
|
||||||
|
// populate proof-of-rotation information
|
||||||
|
pastSignerSigs = new Signature[v3Signer.por.certs.size()];
|
||||||
|
for (int i = 0; i < pastSignerSigs.length; i++) {
|
||||||
|
pastSignerSigs[i] = new Signature(
|
||||||
|
v3Signer.por.certs.get(i).getEncoded());
|
||||||
|
pastSignerSigs[i].setFlags(v3Signer.por.flagsList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (SignatureNotFoundException e) {
|
} catch (SignatureNotFoundException e) {
|
||||||
try {
|
try {
|
||||||
ApkSignatureSchemeV2Verifier.VerifiedSigner v2Signer =
|
ApkSignatureSchemeV2Verifier.VerifiedSigner v2Signer =
|
||||||
@@ -250,7 +260,8 @@ public class ApkSignatureVerifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new SigningDetailsWithDigests(new PackageParser.SigningDetails(signerSigs,
|
return new SigningDetailsWithDigests(new PackageParser.SigningDetails(signerSigs,
|
||||||
SignatureSchemeVersion.SIGNING_BLOCK_V4), vSigner.contentDigests);
|
SignatureSchemeVersion.SIGNING_BLOCK_V4, pastSignerSigs),
|
||||||
|
vSigner.contentDigests);
|
||||||
} catch (SignatureNotFoundException e) {
|
} catch (SignatureNotFoundException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user