Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4305279 authored by Victor Hsieh's avatar Victor Hsieh Committed by Android (Google) Code Review
Browse files

Merge "Move VerityUtils from services.jar to core.jar" into sc-dev

parents 69ff259f c778551a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
# Bug component: 36824

per-file VerityUtils.java = victorhsieh@google.com
+10 −4
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.server.security;
package com.android.internal.security;

import android.annotation.NonNull;
import android.os.Build;
@@ -42,7 +42,7 @@ import java.security.NoSuchAlgorithmException;
import java.util.Arrays;

/** Provides fsverity related operations. */
abstract public class VerityUtils {
public abstract class VerityUtils {
    private static final String TAG = "VerityUtils";

    /**
@@ -156,8 +156,8 @@ abstract public class VerityUtils {
                return SetupResult.failed();
            }
            return SetupResult.ok(Os.dup(rfd), contentSize);
        } catch (IOException | SecurityException | DigestException | NoSuchAlgorithmException |
                SignatureNotFoundException | ErrnoException e) {
        } catch (IOException | SecurityException | DigestException | NoSuchAlgorithmException
                | SignatureNotFoundException | ErrnoException e) {
            Slog.e(TAG, "Failed to set up apk verity: ", e);
            return SetupResult.failed();
        } finally {
@@ -243,14 +243,20 @@ abstract public class VerityUtils {
        private final FileDescriptor mFileDescriptor;
        private final int mContentSize;

        /** @deprecated */
        @Deprecated
        public static SetupResult ok(@NonNull FileDescriptor fileDescriptor, int contentSize) {
            return new SetupResult(RESULT_OK, fileDescriptor, contentSize);
        }

        /** @deprecated */
        @Deprecated
        public static SetupResult skipped() {
            return new SetupResult(RESULT_SKIPPED, null, -1);
        }

        /** @deprecated */
        @Deprecated
        public static SetupResult failed() {
            return new SetupResult(RESULT_FAILED, null, -1);
        }
+1 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ cc_library_shared {
                "com_android_internal_os_Zygote.cpp",
                "com_android_internal_os_ZygoteCommandBuffer.cpp",
                "com_android_internal_os_ZygoteInit.cpp",
                "com_android_internal_security_VerityUtils.cpp",
                "hwbinder/EphemeralStorage.cpp",
                "fd_utils.cpp",
                "android_hardware_input_InputWindowHandle.cpp",
+2 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ extern int register_com_android_internal_os_KernelSingleUidTimeReader(JNIEnv *en
extern int register_com_android_internal_os_Zygote(JNIEnv *env);
extern int register_com_android_internal_os_ZygoteCommandBuffer(JNIEnv *env);
extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env);
extern int register_com_android_internal_security_VerityUtils(JNIEnv* env);
extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env);

// Namespace for Android Runtime flags applied during boot time.
@@ -1534,6 +1535,7 @@ static const RegJNIRec gRegJNI[] = {
        REG_JNI(register_com_android_internal_os_Zygote),
        REG_JNI(register_com_android_internal_os_ZygoteCommandBuffer),
        REG_JNI(register_com_android_internal_os_ZygoteInit),
        REG_JNI(register_com_android_internal_security_VerityUtils),
        REG_JNI(register_com_android_internal_util_VirtualRefBasePtr),
        REG_JNI(register_android_hardware_Camera),
        REG_JNI(register_android_hardware_camera2_CameraMetadata),
Loading