Files
whitebox/api/result.h
Aaron Vaage 41e86ecab9 Code Drop Three (Update Two)
In this update we have:

  - Added the verified platform tests. These tests show how some
    platforms, when verified are allowed to by pass the normal policy
    restrictions. This is done with ChromeOS, thus the name of the
    tests use "chrome_os".

  - Removed WB_RESULT_INVALID_PADDING. This error was when we the
    non-license APIs exposed a AES function with padding. However,
    those functions have been removed from the API and this error is
    no longer used by the API.

  - Tests have been updated to avoid signed-vs-unsigned comparison
    and to use the Chromium path to gTest (which is mocked in this
    library).

  - Tests have been updated to use a new test base and golden data
    system to make them easier to read.
2020-05-30 11:34:32 -07:00

49 lines
1.4 KiB
C

// Copyright 2020 Google LLC. All Rights Reserved.
#ifndef WHITEBOX_API_RESULT_H_
#define WHITEBOX_API_RESULT_H_
#ifdef __cplusplus
extern "C" {
#endif
// Error codes returned by all the white-box API functions. See the function
// returning the result for additional details.
typedef enum {
// The operation completed successfully.
WB_RESULT_OK = 0,
// The operation failed because memory could not be allocated.
WB_RESULT_OUT_OF_MEMORY = 1,
// The state of white-box does not allow execution of this operation. For
// example, another API function may need to be called first.
WB_RESULT_INVALID_STATE = 2,
// The output buffer length is too small to contain the operation's output.
WB_RESULT_BUFFER_TOO_SMALL = 3,
// There is an issue with one or more parameters.
WB_RESULT_INVALID_PARAMETER = 4,
// The message and signature did not pass signature verification.
WB_RESULT_INVALID_SIGNATURE = 5,
// The request key is not available for the operations. For example, no key
// exists for the given key id.
WB_RESULT_KEY_UNAVAILABLE = 6,
// The requested key's security level is not sufficient for the operation.
WB_RESULT_INSUFFICIENT_SECURITY_LEVEL = 7,
// The input data failed to be verified. This may happen if the data was
// corrupted or tampered.
WB_RESULT_DATA_VERIFICATION_ERROR = 8,
} WB_Result;
#ifdef __cplusplus
}
#endif
#endif // WHITEBOX_API_WB_RESULT_H_