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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /* From private/ppb_platform_verification_private.idl,
7 * modified Wed Sep 4 15:08:43 2013.
8 */
9
10 #ifndef PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_
12
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_completion_callback.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
20
21 #define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_1 \
22 "PPB_PlatformVerification_Private;0.1"
23 #define PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE \
24 PPB_PLATFORMVERIFICATION_PRIVATE_INTERFACE_0_1
25
26 /**
27 * @file
28 * This file defines the API for platform verification. Currently, it only
29 * supports Chrome OS.
30 */
31
32
33 /**
34 * @addtogroup Interfaces
35 * @{
36 */
37 /**
38 * The <code>PPB_PlatformVerification_Private</code> interface allows authorized
39 * services to verify that the underlying platform is trusted. An example of
40 * untrusted platform is a Chromebook in developer mode.
41 */
42 struct PPB_PlatformVerification_Private_0_1 {
43 /**
44 * Create() creates a <code>PPB_PlatformVerification_Private</code> object.
45 *
46 * @pram[in] instance A <code>PP_Instance</code> identifying one instance of
47 * a module.
48 *
49 * @return A <code>PP_Resource</code> corresponding to a
50 * <code>PPB_PlatformVerification_Private</code> if successful, 0 if creation
51 * failed.
52 */
53 PP_Resource (*Create)(PP_Instance instance);
54 /**
55 * IsPlatformVerification() determines if the provided resource is a
56 * <code>PPB_PlatformVerification_Private</code>.
57 *
58 * @param[in] resource A <code>PP_Resource</code> corresponding to a
59 * <code>PPB_PlatformVerification_Private</code>.
60 *
61 * @return <code>PP_TRUE</code> if the resource is a
62 * <code>PPB_PlatformVerification_Private</code>, <code>PP_FALSE</code> if the
63 * resource is invalid or some type other than
64 * <code>PPB_PlatformVerification_Private</code>.
65 */
66 PP_Bool (*IsPlatformVerification)(PP_Resource resource);
67 /* Whether the platform can be challenged and is expected to pass.
68 */
69 PP_Bool (*CanChallengePlatform)(void);
70 /**
71 * Requests a platform challenge for a given service id.
72 *
73 * @param[in] service_id A <code>PP_Var</code> of type
74 * <code>PP_VARTYPE_STRING</code> containing the service_id for the challenge.
75 *
76 * @param[in] challenge A <code>PP_Var</code> of type
77 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the challenge data.
78 *
79 * @param[out] signed_data A <code>PP_Var</code> of type
80 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the combined challenge
81 * and nonce data signed by the platform.
82 *
83 * @param[in] signed_data_signature A <code>PP_Var</code> of type
84 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the signature of the
85 * signed data block.
86 *
87 * @param[in] platform_key_certificate A <code>PP_Var</code> of type
88 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the device specific
89 * certificate for the requested service_id.
90 *
91 * @param[in] callback A <code>PP_CompletionCallback</code> to be called after
92 * the platform challenge has been completed. This callback will only run if
93 * the return code is <code>PP_OK_COMPLETIONPENDING</code>.
94 *
95 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
96 */
97 int32_t (*ChallengePlatform)(PP_Instance instance,
98 struct PP_Var service_id,
99 struct PP_Var challenge,
100 struct PP_Var* signed_data,
101 struct PP_Var* signed_data_signature,
102 struct PP_Var* platform_key_certificate,
103 struct PP_CompletionCallback callback);
104 };
105
106
107 typedef struct PPB_PlatformVerification_Private_0_1 PPB_PlatformVerification _Private;
108 /**
109 * @}
110 */
111
112 #endif /* PPAPI_C_PRIVATE_PPB_PLATFORM_VERIFICATION_PRIVATE_H_ */
113
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698