Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: ppapi/c/private/ppb_platform_verification_private.h

Issue 23569005: Add PPAPI interfaces for platform verification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/c/private/ppb_platform_verification_private.h
diff --git a/ppapi/c/private/ppb_platform_verification_private.h b/ppapi/c/private/ppb_platform_verification_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..5c251b75e2746119f4f7bffe03f953c919b2dd57
--- /dev/null
+++ b/ppapi/c/private/ppb_platform_verification_private.h
@@ -0,0 +1,113 @@
+/* Copyright 2013 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* From private/ppb_platform_verification_private.idl,
+ * modified Fri Sep 6 14:45:37 2013.
+ */
+
+#ifndef PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
+#define PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/pp_var.h"
+
+#define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_1 \
+ "PPB_PlatformVerification_Private;0.1"
+#define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE \
+ PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_1
+
+/**
+ * @file
+ * This file defines the API for platform verification. Currently, it only
+ * supports Chrome OS.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/**
+ * The <code>PPB_PlatformVerification_Private</code> interface allows authorized
+ * services to verify that the underlying platform is trusted. An example of
+ * a trusted platform is a Chromebook in verified boot mode.
+ */
+struct PPB_PlatformVerification_Private_0_1 {
+ /**
+ * Create() creates a <code>PPB_PlatformVerification_Private</code> object.
+ *
+ * @pram[in] instance A <code>PP_Instance</code> identifying one instance of
+ * a module.
+ *
+ * @return A <code>PP_Resource</code> corresponding to a
+ * <code>PPB_PlatformVerification_Private</code> if successful, 0 if creation
+ * failed.
+ */
+ PP_Resource (*Create)(PP_Instance instance);
+ /**
+ * IsPlatformVerification() determines if the provided resource is a
+ * <code>PPB_PlatformVerification_Private</code>.
+ *
+ * @param[in] resource A <code>PP_Resource</code> corresponding to a
+ * <code>PPB_PlatformVerification_Private</code>.
+ *
+ * @return <code>PP_TRUE</code> if the resource is a
+ * <code>PPB_PlatformVerification_Private</code>, <code>PP_FALSE</code> if the
+ * resource is invalid or some type other than
+ * <code>PPB_PlatformVerification_Private</code>.
+ */
+ PP_Bool (*IsPlatformVerification)(PP_Resource resource);
+ /* Whether the platform can be challenged and is expected to pass.
+ */
+ PP_Bool (*CanChallengePlatform)(PP_Resource instance);
+ /**
+ * Requests a platform challenge for a given service id.
+ *
+ * @param[in] service_id A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_STRING</code> containing the service_id for the challenge.
+ *
+ * @param[in] challenge A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the challenge data.
+ *
+ * @param[out] signed_data A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the data signed by the
+ * platform.
+ *
+ * @param[out] signed_data_signature A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the signature of the
+ * signed data block.
+ *
+ * @param[out] platform_key_certificate A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_STRING</code> that contains the device specific
+ * certificate for the requested service_id.
+ *
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called after
+ * the platform challenge has been completed. This callback will only run if
+ * the return code is <code>PP_OK_COMPLETIONPENDING</code>.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ */
+ int32_t (*ChallengePlatform)(PP_Resource instance,
+ struct PP_Var service_id,
+ struct PP_Var challenge,
+ struct PP_Var* signed_data,
+ struct PP_Var* signed_data_signature,
+ struct PP_Var* platform_key_certificate,
+ struct PP_CompletionCallback callback);
+};
+
+typedef struct PPB_PlatformVerification_Private_0_1
+ PPB_PlatformVerification_Private;
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_ */
+

Powered by Google App Engine
This is Rietveld 408576698