NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ote_attrs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2017, NVIDIA CORPORATION. All rights reserved
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
42 #ifndef __OTE_ATTRS_H
43 #define __OTE_ATTRS_H
44 
45 #include <sys/types.h>
46 
47 #include <common/ote_error.h>
48 
50 typedef enum {
51  OTE_ATTR_SECRET_VALUE = 0xC0000000U,
52  OTE_ATTR_RSA_MODULES = 0xD0000130U,
55  OTE_ATTR_RSA_PRIME1 = 0xC0000430U,
56  OTE_ATTR_RSA_PRIME2 = 0xC0000530U,
57  OTE_ATTR_RSA_EXPONENT1 = 0xC0000630U,
58  OTE_ATTR_RSA_EXPONENT2 = 0xC0000730U,
59  OTE_ATTR_RSA_COEFFICIENT = 0xC0000830U,
60  OTE_ATTR_DSA_PRIME = 0xD0001031U,
61  OTE_ATTR_DSA_SUBPRIME = 0xD0001131U,
62  OTE_ATTR_DSA_BASE = 0xD0001231U,
63  OTE_ATTR_DSA_PUBLIC_VALUE = 0xD0000131U,
65  OTE_ATTR_DH_PRIME = 0xD0001032U,
66  OTE_ATTR_DH_SUBPRIME = 0xD0001132U,
67  OTE_ATTR_DH_BASE = 0xD0001232U,
68  OTE_ATTR_DH_X_BITS = 0xF0001332U,
69  OTE_ATTR_DH_PUBLIC_VALUE = 0xD0000132U,
71  OTE_ATTR_RSA_OAEP_LABEL = 0xD0000930U,
74 
76 #define OTE_ATTR_VAL 1 << 29
77 #define OTE_ATTR_PUB 1 << 28
78 
82 typedef struct {
84  union {
85  struct {
86  void *buffer;
87  size_t size;
88  } ref;
89 
90  struct {
91  uint32_t a, b;
92  } value;
93  } content;
95 
111  void *buffer, uint32_t size);
112 
122 
132 
140 void te_copy_mem_attribute(void *buffer, te_attribute_t *key);
141 
154  uint32_t a, uint32_t b);
155 
162 
171 
174 #endif
te_error_t te_set_mem_attribute(te_attribute_t *attr, te_attribute_id_t id, void *buffer, uint32_t size)
Sets up a memory attribute struct for use in other functions.
OTE_ATTR_PUB.
Definition: ote_attrs.h:71
size_t size
Definition: ote_attrs.h:87
OTE_ATTR_PUB.
Definition: ote_attrs.h:69
uint32_t b
Definition: ote_attrs.h:91
OTE_ATTR_VAL | OTE_ATTR_PUB.
Definition: ote_attrs.h:68
void * buffer
Definition: ote_attrs.h:86
OTE_ATTR_VAL | OTE_ATTR_PUB.
Definition: ote_attrs.h:72
te_attribute_id_t
Defines attribute ID types.
Definition: ote_attrs.h:50
OTE_ATTR_PUB.
Definition: ote_attrs.h:66
OTE_ATTR_PUB.
Definition: ote_attrs.h:67
NVIDIA Trusted Little Kernel Interface: Error Handling
OTE_ATTR_PUB.
Definition: ote_attrs.h:65
OTE_ATTR_PUB.
Definition: ote_attrs.h:61
OTE_ATTR_PUB.
Definition: ote_attrs.h:62
te_attribute_id_t id
Definition: ote_attrs.h:83
te_error_t te_set_int_attribute(te_attribute_t *attr, te_attribute_id_t id, uint32_t a, uint32_t b)
Sets the integer attribute.
te_error_t te_get_mem_attribute_buffer(te_attribute_t *attr, void **ret)
Gets a memory attribute buffer.
Defines attribute object internals.
Definition: ote_attrs.h:82
OTE_ATTR_PUB.
Definition: ote_attrs.h:52
OTE_ATTR_PUB.
Definition: ote_attrs.h:63
te_error_t te_get_mem_attribute_size(te_attribute_t *attr, size_t *ret)
Gets memory attribute size.
void te_copy_mem_attribute(void *buffer, te_attribute_t *key)
Copies the memory attribute.
te_error_t
Defines Open Trusted Environment (OTE) error codes.
Definition: ote_error.h:45
void te_free_internal_attribute(te_attribute_t *attr)
Frees internal attribute memory.
te_error_t te_copy_attribute(te_attribute_t *dst, te_attribute_t *src)
Copies attribute internals.