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

Commit 4f9599e4 authored by Roberto Pereira's avatar Roberto Pereira
Browse files

Run clang-format on all trusty/keymaster .cpp and .h files

Test: Compiles
Bug: 110153632
Change-Id: Ib6e1df87d3c3dfd8c507768d9018114a1b962d74
parent 7b1d163c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -578,8 +578,8 @@ keymaster_error_t TrustyKeymasterDevice::finish(keymaster_operation_handle_t ope
        return error_;
    }
    if (input && input->data_length > kMaximumFinishInputLength) {
        ALOGE("%zu-byte input to finish; only %zu bytes allowed",
              input->data_length, kMaximumFinishInputLength);
        ALOGE("%zu-byte input to finish; only %zu bytes allowed", input->data_length,
              kMaximumFinishInputLength);
        return KM_ERROR_INVALID_INPUT_LENGTH;
    }

+39 −40
Original line number Diff line number Diff line
@@ -29,12 +29,12 @@
#include <keymaster/soft_keymaster_context.h>

#include "android_keymaster_test_utils.h"
#include "trusty_keymaster_device.h"
#include "openssl_utils.h"
#include "trusty_keymaster_device.h"

using std::string;
using std::ifstream;
using std::istreambuf_iterator;
using std::string;

static keymaster::AndroidKeymaster* impl_ = nullptr;

@@ -95,14 +95,13 @@ int trusty_keymaster_call(uint32_t cmd, void* in_buf, uint32_t in_size, void* ou
            return fake_call(impl_, &keymaster::AndroidKeymaster::FinishOperation, in_buf, in_size,
                             out_buf, out_size);
        case KM_IMPORT_KEY:
        return fake_call(impl_, &keymaster::AndroidKeymaster::ImportKey, in_buf, in_size, out_buf,
                           out_size);
            return fake_call(impl_, &keymaster::AndroidKeymaster::ImportKey, in_buf, in_size,
                             out_buf, out_size);
        case KM_EXPORT_KEY:
        return fake_call(impl_, &keymaster::AndroidKeymaster::ExportKey, in_buf, in_size, out_buf,
                           out_size);
            return fake_call(impl_, &keymaster::AndroidKeymaster::ExportKey, in_buf, in_size,
                             out_buf, out_size);
    }
    return -EINVAL;

}

namespace keymaster {
@@ -323,9 +322,9 @@ TEST_F(VerificationTest, RsaBadSignature) {

    Malloc_Delete sig_deleter(signature);
    signature[siglen / 2]++;
    EXPECT_EQ(
        KM_ERROR_VERIFICATION_FAILED,
        device.verify_data(&sig_params, ptr, size, message.get(), message_len, signature, siglen));
    EXPECT_EQ(KM_ERROR_VERIFICATION_FAILED,
              device.verify_data(&sig_params, ptr, size, message.get(), message_len, signature,
                                 siglen));
}

TEST_F(VerificationTest, RsaBadMessage) {
@@ -345,9 +344,9 @@ TEST_F(VerificationTest, RsaBadMessage) {
                                            &signature, &siglen));
    Malloc_Delete sig_deleter(signature);
    message[0]++;
    EXPECT_EQ(
        KM_ERROR_VERIFICATION_FAILED,
        device.verify_data(&sig_params, ptr, size, message.get(), message_len, signature, siglen));
    EXPECT_EQ(KM_ERROR_VERIFICATION_FAILED,
              device.verify_data(&sig_params, ptr, size, message.get(), message_len, signature,
                                 siglen));
}

TEST_F(VerificationTest, RsaShortMessage) {