]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Kms.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / Kms.h
index da27096e44be403f9e23d223c2d912f7d0c00e00..7dac7efcdc03b3c7d6eba7fd17fd80884219c6cc 100644 (file)
@@ -8,14 +8,8 @@
   server over the network, or to a Hardware Security Module (HSM) attached to the system it\r
   runs on, or anything else that is capable of providing the key management service.\r
 \r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available under\r
-  the terms and conditions of the BSD License that accompanies this distribution.\r
-  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -80,6 +74,10 @@ typedef struct _EFI_KMS_PROTOCOL EFI_KMS_PROTOCOL;
   { \\r
     0xb9237513, 0x6c44, 0x4411, {0xa9, 0x90, 0x21, 0xe5, 0x56, 0xe0, 0x5a, 0xde } \\r
   }\r
+#define EFI_KMS_FORMAT_GENERIC_DYNAMIC_GUID \\r
+  { \\r
+    0x2156e996, 0x66de, 0x4b27, {0x9c, 0xc9, 0xb0, 0x9f, 0xac, 0x4d, 0x2, 0xbe } \\r
+  }\r
 ///@}\r
 \r
 ///\r
@@ -175,6 +173,17 @@ typedef struct _EFI_KMS_PROTOCOL EFI_KMS_PROTOCOL;
 #define EFI_KMS_ATTRIBUTE_TYPE_STRUCTURE        0x0A\r
 #define EFI_KMS_ATTRIBUTE_TYPE_DYNAMIC          0x0B\r
 \r
+typedef struct {\r
+  ///\r
+  /// Length in bytes of the KeyData.\r
+  ///\r
+  UINT32        KeySize;\r
+  ///\r
+  /// The data of the key.\r
+  ///\r
+  UINT8         KeyData[1];\r
+} EFI_KMS_FORMAT_GENERIC_DYNAMIC;\r
+\r
 typedef struct {\r
   ///\r
   /// The size in bytes for the client identifier.\r
@@ -358,7 +367,7 @@ EFI_STATUS
 \r
   @param[in]      This              Pointer to the EFI_KMS_PROTOCOL instance.\r
   @param[in]      Client            Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r
-  @param[in, out] ClientDataSize    Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize    Pointer to the size, in bytes, of an arbitrary block of\r
                                     data specified by the ClientData parameter. This\r
                                     parameter may be NULL, in which case the ClientData\r
                                     parameter will be ignored and no data will be\r
@@ -373,11 +382,11 @@ EFI_STATUS
                                     which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData        Pointer to a pointer to an arbitrary block of data of\r
                                     *ClientDataSize that is to be passed directly to the\r
-                                    KMS if it supports the use of client data. This \r
-                                    parameter may be NULL if and only if the \r
+                                    KMS if it supports the use of client data. This\r
+                                    parameter may be NULL if and only if the\r
                                     ClientDataSize parameter is also NULL. Upon return to\r
-                                    the caller, *ClientData points to a block of data of \r
-                                    *ClientDataSize that was returned from the KMS. \r
+                                    the caller, *ClientData points to a block of data of\r
+                                    *ClientDataSize that was returned from the KMS.\r
                                     If the returned value for *ClientDataSize is zero,\r
                                     then the returned value for *ClientData must be NULL\r
                                     and should be ignored by the caller. The KMS protocol\r
@@ -403,7 +412,7 @@ EFI_STATUS
   IN EFI_KMS_CLIENT_INFO        *Client,\r
   IN OUT UINTN                  *ClientDataSize OPTIONAL,\r
   IN OUT VOID                   **ClientData OPTIONAL\r
-  ); \r
+  );\r
 \r
 /**\r
   Request that the KMS generate one or more new keys and associate them with key identifiers.\r
@@ -439,7 +448,7 @@ EFI_STATUS
                                      type and must be freed by the caller when it is no longer\r
                                      needed. Also, the KeyStatus field must reflect the result\r
                                      of the request relative to that key.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -454,11 +463,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -520,12 +529,12 @@ EFI_STATUS
                                      On output, the KeyIdentifierSize and KeyIdentifier fields\r
                                      will be unchanged, while the KeyFormat and KeyValue\r
                                      fields will be updated values associated with this key\r
-                                     identifier. Memory for the KeyValue field will be \r
+                                     identifier. Memory for the KeyValue field will be\r
                                      allocated with the BOOT_SERVICES_DATA type and\r
                                      must be freed by the caller when it is no longer needed.\r
                                      Also, the KeyStatus field will reflect the result of the\r
                                      request relative to the individual key descriptor.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -540,11 +549,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -611,7 +620,7 @@ EFI_STATUS
                                      consistent values to be associated with the given KeyId.\r
                                      On return, the KeyStatus field will reflect the result\r
                                      of the operation for each key request.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -626,11 +635,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -696,7 +705,7 @@ EFI_STATUS
                                      KeyValue fields are ignored, but should be 0.\r
                                      On return, the KeyStatus field will reflect the result\r
                                      of the operation for each key request.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -711,11 +720,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -774,7 +783,7 @@ EFI_STATUS
                                      On input, the fields in the structure should be NULL.\r
                                      On output, the attribute fields will have updated values\r
                                      for attributes associated with this key identifier.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -789,11 +798,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -861,7 +870,7 @@ EFI_STATUS
                                      are completely filled in.\r
                                      On return the KeyAttributeStatus field will reflect the\r
                                      result of the operation for each key attribute request.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -876,11 +885,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -952,7 +961,7 @@ EFI_STATUS
                                      are completely filled in.\r
                                      On return the KeyAttributeStatus field will reflect the\r
                                      result of the operation for each key attribute request.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -967,11 +976,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r
@@ -1049,7 +1058,7 @@ EFI_STATUS
                                      caller when it is no longer needed. Also, the KeyStatus\r
                                      field of each descriptor will reflect the result of the\r
                                      request relative to that key descriptor.\r
-  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of \r
+  @param[in, out] ClientDataSize     Pointer to the size, in bytes, of an arbitrary block of\r
                                      data specified by the ClientData parameter. This\r
                                      parameter may be NULL, in which case the ClientData\r
                                      parameter will be ignored and no data will be\r
@@ -1064,11 +1073,11 @@ EFI_STATUS
                                      which will be zero if no data is returned from the KMS.\r
   @param[in, out] ClientData         Pointer to a pointer to an arbitrary block of data of\r
                                      *ClientDataSize that is to be passed directly to the\r
-                                     KMS if it supports the use of client data. This \r
-                                     parameter may be NULL if and only if the \r
+                                     KMS if it supports the use of client data. This\r
+                                     parameter may be NULL if and only if the\r
                                      ClientDataSize parameter is also NULL. Upon return to\r
-                                     the caller, *ClientData points to a block of data of \r
-                                     *ClientDataSize that was returned from the KMS. \r
+                                     the caller, *ClientData points to a block of data of\r
+                                     *ClientDataSize that was returned from the KMS.\r
                                      If the returned value for *ClientDataSize is zero,\r
                                      then the returned value for *ClientData must be NULL\r
                                      and should be ignored by the caller. The KMS protocol\r