Merge "Stop verifying fs-verity signature in kernel" am: 62b3b39e9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2345209 Change-Id: Ice03d3521870b42f78b0397d5caf647a903da539 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -186,8 +186,8 @@ public final class FontManagerService extends IFontManager.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpFsverity(String filePath, byte[] pkcs7Signature) throws IOException {
|
||||
VerityUtils.setUpFsverity(filePath, pkcs7Signature);
|
||||
public void setUpFsverity(String filePath) throws IOException {
|
||||
VerityUtils.setUpFsverity(filePath, /* signature */ (byte[]) null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,7 +78,7 @@ final class UpdatableFontDir {
|
||||
interface FsverityUtil {
|
||||
boolean isFromTrustedProvider(String path, byte[] pkcs7Signature);
|
||||
|
||||
void setUpFsverity(String path, byte[] pkcs7Signature) throws IOException;
|
||||
void setUpFsverity(String path) throws IOException;
|
||||
|
||||
boolean rename(File src, File dest);
|
||||
}
|
||||
@@ -354,8 +354,7 @@ final class UpdatableFontDir {
|
||||
try {
|
||||
// Do not parse font file before setting up fs-verity.
|
||||
// setUpFsverity throws IOException if failed.
|
||||
mFsverityUtil.setUpFsverity(tempNewFontFile.getAbsolutePath(),
|
||||
pkcs7Signature);
|
||||
mFsverityUtil.setUpFsverity(tempNewFontFile.getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
throw new SystemFontException(
|
||||
FontManager.RESULT_ERROR_VERIFICATION_FAILURE,
|
||||
|
||||
@@ -109,17 +109,16 @@ public final class UpdatableFontDirTest {
|
||||
|
||||
@Override
|
||||
public boolean isFromTrustedProvider(String path, byte[] signature) {
|
||||
return mHasFsverityPaths.contains(path);
|
||||
if (!mHasFsverityPaths.contains(path)) {
|
||||
return false;
|
||||
}
|
||||
String fakeSignature = new String(signature, StandardCharsets.UTF_8);
|
||||
return GOOD_SIGNATURE.equals(fakeSignature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpFsverity(String path, byte[] pkcs7Signature) throws IOException {
|
||||
String fakeSignature = new String(pkcs7Signature, StandardCharsets.UTF_8);
|
||||
if (GOOD_SIGNATURE.equals(fakeSignature)) {
|
||||
mHasFsverityPaths.add(path);
|
||||
} else {
|
||||
throw new IOException("Failed to set up fake fs-verity");
|
||||
}
|
||||
public void setUpFsverity(String path) throws IOException {
|
||||
mHasFsverityPaths.add(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -813,8 +812,8 @@ public final class UpdatableFontDirTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpFsverity(String path, byte[] pkcs7Signature) throws IOException {
|
||||
mFakeFsverityUtil.setUpFsverity(path, pkcs7Signature);
|
||||
public void setUpFsverity(String path) throws IOException {
|
||||
mFakeFsverityUtil.setUpFsverity(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user