]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Include/Library/TlsLib.h
e71291eaea453bcb914878d8b77d474f13f3178d
[mirror_edk2.git] / CryptoPkg / Include / Library / TlsLib.h
1 /** @file
2 Defines TLS Library APIs.
3
4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __TLS_LIB_H__
16 #define __TLS_LIB_H__
17
18 /**
19 Initializes the OpenSSL library.
20
21 This function registers ciphers and digests used directly and indirectly
22 by SSL/TLS, and initializes the readable error messages.
23 This function must be called before any other action takes places.
24
25 @retval TRUE The OpenSSL library has been initialized.
26 @retval FALSE Failed to initialize the OpenSSL library.
27
28 **/
29 BOOLEAN
30 EFIAPI
31 TlsInitialize (
32 VOID
33 );
34
35 /**
36 Free an allocated SSL_CTX object.
37
38 @param[in] TlsCtx Pointer to the SSL_CTX object to be released.
39
40 **/
41 VOID
42 EFIAPI
43 TlsCtxFree (
44 IN VOID *TlsCtx
45 );
46
47 /**
48 Creates a new SSL_CTX object as framework to establish TLS/SSL enabled
49 connections.
50
51 @param[in] MajorVer Major Version of TLS/SSL Protocol.
52 @param[in] MinorVer Minor Version of TLS/SSL Protocol.
53
54 @return Pointer to an allocated SSL_CTX object.
55 If the creation failed, TlsCtxNew() returns NULL.
56
57 **/
58 VOID *
59 EFIAPI
60 TlsCtxNew (
61 IN UINT8 MajorVer,
62 IN UINT8 MinorVer
63 );
64
65 /**
66 Free an allocated TLS object.
67
68 This function removes the TLS object pointed to by Tls and frees up the
69 allocated memory. If Tls is NULL, nothing is done.
70
71 @param[in] Tls Pointer to the TLS object to be freed.
72
73 **/
74 VOID
75 EFIAPI
76 TlsFree (
77 IN VOID *Tls
78 );
79
80 /**
81 Create a new TLS object for a connection.
82
83 This function creates a new TLS object for a connection. The new object
84 inherits the setting of the underlying context TlsCtx: connection method,
85 options, verification setting.
86
87 @param[in] TlsCtx Pointer to the SSL_CTX object.
88
89 @return Pointer to an allocated SSL object.
90 If the creation failed, TlsNew() returns NULL.
91
92 **/
93 VOID *
94 EFIAPI
95 TlsNew (
96 IN VOID *TlsCtx
97 );
98
99 /**
100 Checks if the TLS handshake was done.
101
102 This function will check if the specified TLS handshake was done.
103
104 @param[in] Tls Pointer to the TLS object for handshake state checking.
105
106 @retval TRUE The TLS handshake was done.
107 @retval FALSE The TLS handshake was not done.
108
109 **/
110 BOOLEAN
111 EFIAPI
112 TlsInHandshake (
113 IN VOID *Tls
114 );
115
116 /**
117 Perform a TLS/SSL handshake.
118
119 This function will perform a TLS/SSL handshake.
120
121 @param[in] Tls Pointer to the TLS object for handshake operation.
122 @param[in] BufferIn Pointer to the most recently received TLS Handshake packet.
123 @param[in] BufferInSize Packet size in bytes for the most recently received TLS
124 Handshake packet.
125 @param[out] BufferOut Pointer to the buffer to hold the built packet.
126 @param[in, out] BufferOutSize Pointer to the buffer size in bytes. On input, it is
127 the buffer size provided by the caller. On output, it
128 is the buffer size in fact needed to contain the
129 packet.
130
131 @retval EFI_SUCCESS The required TLS packet is built successfully.
132 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
133 Tls is NULL.
134 BufferIn is NULL but BufferInSize is NOT 0.
135 BufferInSize is 0 but BufferIn is NOT NULL.
136 BufferOutSize is NULL.
137 BufferOut is NULL if *BufferOutSize is not zero.
138 @retval EFI_BUFFER_TOO_SMALL BufferOutSize is too small to hold the response packet.
139 @retval EFI_ABORTED Something wrong during handshake.
140
141 **/
142 EFI_STATUS
143 EFIAPI
144 TlsDoHandshake (
145 IN VOID *Tls,
146 IN UINT8 *BufferIn, OPTIONAL
147 IN UINTN BufferInSize, OPTIONAL
148 OUT UINT8 *BufferOut, OPTIONAL
149 IN OUT UINTN *BufferOutSize
150 );
151
152 /**
153 Handle Alert message recorded in BufferIn. If BufferIn is NULL and BufferInSize is zero,
154 TLS session has errors and the response packet needs to be Alert message based on error type.
155
156 @param[in] Tls Pointer to the TLS object for state checking.
157 @param[in] BufferIn Pointer to the most recently received TLS Alert packet.
158 @param[in] BufferInSize Packet size in bytes for the most recently received TLS
159 Alert packet.
160 @param[out] BufferOut Pointer to the buffer to hold the built packet.
161 @param[in, out] BufferOutSize Pointer to the buffer size in bytes. On input, it is
162 the buffer size provided by the caller. On output, it
163 is the buffer size in fact needed to contain the
164 packet.
165
166 @retval EFI_SUCCESS The required TLS packet is built successfully.
167 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
168 Tls is NULL.
169 BufferIn is NULL but BufferInSize is NOT 0.
170 BufferInSize is 0 but BufferIn is NOT NULL.
171 BufferOutSize is NULL.
172 BufferOut is NULL if *BufferOutSize is not zero.
173 @retval EFI_ABORTED An error occurred.
174 @retval EFI_BUFFER_TOO_SMALL BufferOutSize is too small to hold the response packet.
175
176 **/
177 EFI_STATUS
178 EFIAPI
179 TlsHandleAlert (
180 IN VOID *Tls,
181 IN UINT8 *BufferIn, OPTIONAL
182 IN UINTN BufferInSize, OPTIONAL
183 OUT UINT8 *BufferOut, OPTIONAL
184 IN OUT UINTN *BufferOutSize
185 );
186
187 /**
188 Build the CloseNotify packet.
189
190 @param[in] Tls Pointer to the TLS object for state checking.
191 @param[in, out] Buffer Pointer to the buffer to hold the built packet.
192 @param[in, out] BufferSize Pointer to the buffer size in bytes. On input, it is
193 the buffer size provided by the caller. On output, it
194 is the buffer size in fact needed to contain the
195 packet.
196
197 @retval EFI_SUCCESS The required TLS packet is built successfully.
198 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
199 Tls is NULL.
200 BufferSize is NULL.
201 Buffer is NULL if *BufferSize is not zero.
202 @retval EFI_BUFFER_TOO_SMALL BufferSize is too small to hold the response packet.
203
204 **/
205 EFI_STATUS
206 EFIAPI
207 TlsCloseNotify (
208 IN VOID *Tls,
209 IN OUT UINT8 *Buffer,
210 IN OUT UINTN *BufferSize
211 );
212
213 /**
214 Attempts to read bytes from one TLS object and places the data in Buffer.
215
216 This function will attempt to read BufferSize bytes from the TLS object
217 and places the data in Buffer.
218
219 @param[in] Tls Pointer to the TLS object.
220 @param[in,out] Buffer Pointer to the buffer to store the data.
221 @param[in] BufferSize The size of Buffer in bytes.
222
223 @retval >0 The amount of data successfully read from the TLS object.
224 @retval <=0 No data was successfully read.
225
226 **/
227 INTN
228 EFIAPI
229 TlsCtrlTrafficOut (
230 IN VOID *Tls,
231 IN OUT VOID *Buffer,
232 IN UINTN BufferSize
233 );
234
235 /**
236 Attempts to write data from the buffer to TLS object.
237
238 This function will attempt to write BufferSize bytes data from the Buffer
239 to the TLS object.
240
241 @param[in] Tls Pointer to the TLS object.
242 @param[in] Buffer Pointer to the data buffer.
243 @param[in] BufferSize The size of Buffer in bytes.
244
245 @retval >0 The amount of data successfully written to the TLS object.
246 @retval <=0 No data was successfully written.
247
248 **/
249 INTN
250 EFIAPI
251 TlsCtrlTrafficIn (
252 IN VOID *Tls,
253 IN VOID *Buffer,
254 IN UINTN BufferSize
255 );
256
257 /**
258 Attempts to read bytes from the specified TLS connection into the buffer.
259
260 This function tries to read BufferSize bytes data from the specified TLS
261 connection into the Buffer.
262
263 @param[in] Tls Pointer to the TLS connection for data reading.
264 @param[in,out] Buffer Pointer to the data buffer.
265 @param[in] BufferSize The size of Buffer in bytes.
266
267 @retval >0 The read operation was successful, and return value is the
268 number of bytes actually read from the TLS connection.
269 @retval <=0 The read operation was not successful.
270
271 **/
272 INTN
273 EFIAPI
274 TlsRead (
275 IN VOID *Tls,
276 IN OUT VOID *Buffer,
277 IN UINTN BufferSize
278 );
279
280 /**
281 Attempts to write data to a TLS connection.
282
283 This function tries to write BufferSize bytes data from the Buffer into the
284 specified TLS connection.
285
286 @param[in] Tls Pointer to the TLS connection for data writing.
287 @param[in] Buffer Pointer to the data buffer.
288 @param[in] BufferSize The size of Buffer in bytes.
289
290 @retval >0 The write operation was successful, and return value is the
291 number of bytes actually written to the TLS connection.
292 @retval <=0 The write operation was not successful.
293
294 **/
295 INTN
296 EFIAPI
297 TlsWrite (
298 IN VOID *Tls,
299 IN VOID *Buffer,
300 IN UINTN BufferSize
301 );
302
303 /**
304 Set a new TLS/SSL method for a particular TLS object.
305
306 This function sets a new TLS/SSL method for a particular TLS object.
307
308 @param[in] Tls Pointer to a TLS object.
309 @param[in] MajorVer Major Version of TLS/SSL Protocol.
310 @param[in] MinorVer Minor Version of TLS/SSL Protocol.
311
312 @retval EFI_SUCCESS The TLS/SSL method was set successfully.
313 @retval EFI_INVALID_PARAMETER The parameter is invalid.
314 @retval EFI_UNSUPPORTED Unsupported TLS/SSL method.
315
316 **/
317 EFI_STATUS
318 EFIAPI
319 TlsSetVersion (
320 IN VOID *Tls,
321 IN UINT8 MajorVer,
322 IN UINT8 MinorVer
323 );
324
325 /**
326 Set TLS object to work in client or server mode.
327
328 This function prepares a TLS object to work in client or server mode.
329
330 @param[in] Tls Pointer to a TLS object.
331 @param[in] IsServer Work in server mode.
332
333 @retval EFI_SUCCESS The TLS/SSL work mode was set successfully.
334 @retval EFI_INVALID_PARAMETER The parameter is invalid.
335 @retval EFI_UNSUPPORTED Unsupported TLS/SSL work mode.
336
337 **/
338 EFI_STATUS
339 EFIAPI
340 TlsSetConnectionEnd (
341 IN VOID *Tls,
342 IN BOOLEAN IsServer
343 );
344
345 /**
346 Set the ciphers list to be used by the TLS object.
347
348 This function sets the ciphers for use by a specified TLS object.
349
350 @param[in] Tls Pointer to a TLS object.
351 @param[in] CipherId Array of UINT16 cipher identifiers. Each UINT16
352 cipher identifier comes from the TLS Cipher Suite
353 Registry of the IANA, interpreting Byte1 and Byte2
354 in network (big endian) byte order.
355 @param[in] CipherNum The number of cipher in the list.
356
357 @retval EFI_SUCCESS The ciphers list was set successfully.
358 @retval EFI_INVALID_PARAMETER The parameter is invalid.
359 @retval EFI_UNSUPPORTED No supported TLS cipher was found in CipherId.
360 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
361
362 **/
363 EFI_STATUS
364 EFIAPI
365 TlsSetCipherList (
366 IN VOID *Tls,
367 IN UINT16 *CipherId,
368 IN UINTN CipherNum
369 );
370
371 /**
372 Set the compression method for TLS/SSL operations.
373
374 This function handles TLS/SSL integrated compression methods.
375
376 @param[in] CompMethod The compression method ID.
377
378 @retval EFI_SUCCESS The compression method for the communication was
379 set successfully.
380 @retval EFI_UNSUPPORTED Unsupported compression method.
381
382 **/
383 EFI_STATUS
384 EFIAPI
385 TlsSetCompressionMethod (
386 IN UINT8 CompMethod
387 );
388
389 /**
390 Set peer certificate verification mode for the TLS connection.
391
392 This function sets the verification mode flags for the TLS connection.
393
394 @param[in] Tls Pointer to the TLS object.
395 @param[in] VerifyMode A set of logically or'ed verification mode flags.
396
397 **/
398 VOID
399 EFIAPI
400 TlsSetVerify (
401 IN VOID *Tls,
402 IN UINT32 VerifyMode
403 );
404
405 /**
406 Sets a TLS/SSL session ID to be used during TLS/SSL connect.
407
408 This function sets a session ID to be used when the TLS/SSL connection is
409 to be established.
410
411 @param[in] Tls Pointer to the TLS object.
412 @param[in] SessionId Session ID data used for session resumption.
413 @param[in] SessionIdLen Length of Session ID in bytes.
414
415 @retval EFI_SUCCESS Session ID was set successfully.
416 @retval EFI_INVALID_PARAMETER The parameter is invalid.
417 @retval EFI_UNSUPPORTED No available session for ID setting.
418
419 **/
420 EFI_STATUS
421 EFIAPI
422 TlsSetSessionId (
423 IN VOID *Tls,
424 IN UINT8 *SessionId,
425 IN UINT16 SessionIdLen
426 );
427
428 /**
429 Adds the CA to the cert store when requesting Server or Client authentication.
430
431 This function adds the CA certificate to the list of CAs when requesting
432 Server or Client authentication for the chosen TLS connection.
433
434 @param[in] Tls Pointer to the TLS object.
435 @param[in] Data Pointer to the data buffer of a DER-encoded binary
436 X.509 certificate or PEM-encoded X.509 certificate.
437 @param[in] DataSize The size of data buffer in bytes.
438
439 @retval EFI_SUCCESS The operation succeeded.
440 @retval EFI_INVALID_PARAMETER The parameter is invalid.
441 @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
442 @retval EFI_ABORTED Invalid X.509 certificate.
443
444 **/
445 EFI_STATUS
446 EFIAPI
447 TlsSetCaCertificate (
448 IN VOID *Tls,
449 IN VOID *Data,
450 IN UINTN DataSize
451 );
452
453 /**
454 Loads the local public certificate into the specified TLS object.
455
456 This function loads the X.509 certificate into the specified TLS object
457 for TLS negotiation.
458
459 @param[in] Tls Pointer to the TLS object.
460 @param[in] Data Pointer to the data buffer of a DER-encoded binary
461 X.509 certificate or PEM-encoded X.509 certificate.
462 @param[in] DataSize The size of data buffer in bytes.
463
464 @retval EFI_SUCCESS The operation succeeded.
465 @retval EFI_INVALID_PARAMETER The parameter is invalid.
466 @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
467 @retval EFI_ABORTED Invalid X.509 certificate.
468
469 **/
470 EFI_STATUS
471 EFIAPI
472 TlsSetHostPublicCert (
473 IN VOID *Tls,
474 IN VOID *Data,
475 IN UINTN DataSize
476 );
477
478 /**
479 Adds the local private key to the specified TLS object.
480
481 This function adds the local private key (PEM-encoded RSA or PKCS#8 private
482 key) into the specified TLS object for TLS negotiation.
483
484 @param[in] Tls Pointer to the TLS object.
485 @param[in] Data Pointer to the data buffer of a PEM-encoded RSA
486 or PKCS#8 private key.
487 @param[in] DataSize The size of data buffer in bytes.
488
489 @retval EFI_SUCCESS The operation succeeded.
490 @retval EFI_UNSUPPORTED This function is not supported.
491 @retval EFI_ABORTED Invalid private key data.
492
493 **/
494 EFI_STATUS
495 EFIAPI
496 TlsSetHostPrivateKey (
497 IN VOID *Tls,
498 IN VOID *Data,
499 IN UINTN DataSize
500 );
501
502 /**
503 Adds the CA-supplied certificate revocation list for certificate validation.
504
505 This function adds the CA-supplied certificate revocation list data for
506 certificate validity checking.
507
508 @param[in] Data Pointer to the data buffer of a DER-encoded CRL data.
509 @param[in] DataSize The size of data buffer in bytes.
510
511 @retval EFI_SUCCESS The operation succeeded.
512 @retval EFI_UNSUPPORTED This function is not supported.
513 @retval EFI_ABORTED Invalid CRL data.
514
515 **/
516 EFI_STATUS
517 EFIAPI
518 TlsSetCertRevocationList (
519 IN VOID *Data,
520 IN UINTN DataSize
521 );
522
523 /**
524 Gets the protocol version used by the specified TLS connection.
525
526 This function returns the protocol version used by the specified TLS
527 connection.
528
529 If Tls is NULL, then ASSERT().
530
531 @param[in] Tls Pointer to the TLS object.
532
533 @return The protocol version of the specified TLS connection.
534
535 **/
536 UINT16
537 EFIAPI
538 TlsGetVersion (
539 IN VOID *Tls
540 );
541
542 /**
543 Gets the connection end of the specified TLS connection.
544
545 This function returns the connection end (as client or as server) used by
546 the specified TLS connection.
547
548 If Tls is NULL, then ASSERT().
549
550 @param[in] Tls Pointer to the TLS object.
551
552 @return The connection end used by the specified TLS connection.
553
554 **/
555 UINT8
556 EFIAPI
557 TlsGetConnectionEnd (
558 IN VOID *Tls
559 );
560
561 /**
562 Gets the cipher suite used by the specified TLS connection.
563
564 This function returns current cipher suite used by the specified
565 TLS connection.
566
567 @param[in] Tls Pointer to the TLS object.
568 @param[in,out] CipherId The cipher suite used by the TLS object.
569
570 @retval EFI_SUCCESS The cipher suite was returned successfully.
571 @retval EFI_INVALID_PARAMETER The parameter is invalid.
572 @retval EFI_UNSUPPORTED Unsupported cipher suite.
573
574 **/
575 EFI_STATUS
576 EFIAPI
577 TlsGetCurrentCipher (
578 IN VOID *Tls,
579 IN OUT UINT16 *CipherId
580 );
581
582 /**
583 Gets the compression methods used by the specified TLS connection.
584
585 This function returns current integrated compression methods used by
586 the specified TLS connection.
587
588 @param[in] Tls Pointer to the TLS object.
589 @param[in,out] CompressionId The current compression method used by
590 the TLS object.
591
592 @retval EFI_SUCCESS The compression method was returned successfully.
593 @retval EFI_INVALID_PARAMETER The parameter is invalid.
594 @retval EFI_ABORTED Invalid Compression method.
595 @retval EFI_UNSUPPORTED This function is not supported.
596
597 **/
598 EFI_STATUS
599 EFIAPI
600 TlsGetCurrentCompressionId (
601 IN VOID *Tls,
602 IN OUT UINT8 *CompressionId
603 );
604
605 /**
606 Gets the verification mode currently set in the TLS connection.
607
608 This function returns the peer verification mode currently set in the
609 specified TLS connection.
610
611 If Tls is NULL, then ASSERT().
612
613 @param[in] Tls Pointer to the TLS object.
614
615 @return The verification mode set in the specified TLS connection.
616
617 **/
618 UINT32
619 EFIAPI
620 TlsGetVerify (
621 IN VOID *Tls
622 );
623
624 /**
625 Gets the session ID used by the specified TLS connection.
626
627 This function returns the TLS/SSL session ID currently used by the
628 specified TLS connection.
629
630 @param[in] Tls Pointer to the TLS object.
631 @param[in,out] SessionId Buffer to contain the returned session ID.
632 @param[in,out] SessionIdLen The length of Session ID in bytes.
633
634 @retval EFI_SUCCESS The Session ID was returned successfully.
635 @retval EFI_INVALID_PARAMETER The parameter is invalid.
636 @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
637
638 **/
639 EFI_STATUS
640 EFIAPI
641 TlsGetSessionId (
642 IN VOID *Tls,
643 IN OUT UINT8 *SessionId,
644 IN OUT UINT16 *SessionIdLen
645 );
646
647 /**
648 Gets the client random data used in the specified TLS connection.
649
650 This function returns the TLS/SSL client random data currently used in
651 the specified TLS connection.
652
653 @param[in] Tls Pointer to the TLS object.
654 @param[in,out] ClientRandom Buffer to contain the returned client
655 random data (32 bytes).
656
657 **/
658 VOID
659 EFIAPI
660 TlsGetClientRandom (
661 IN VOID *Tls,
662 IN OUT UINT8 *ClientRandom
663 );
664
665 /**
666 Gets the server random data used in the specified TLS connection.
667
668 This function returns the TLS/SSL server random data currently used in
669 the specified TLS connection.
670
671 @param[in] Tls Pointer to the TLS object.
672 @param[in,out] ServerRandom Buffer to contain the returned server
673 random data (32 bytes).
674
675 **/
676 VOID
677 EFIAPI
678 TlsGetServerRandom (
679 IN VOID *Tls,
680 IN OUT UINT8 *ServerRandom
681 );
682
683 /**
684 Gets the master key data used in the specified TLS connection.
685
686 This function returns the TLS/SSL master key material currently used in
687 the specified TLS connection.
688
689 @param[in] Tls Pointer to the TLS object.
690 @param[in,out] KeyMaterial Buffer to contain the returned key material.
691
692 @retval EFI_SUCCESS Key material was returned successfully.
693 @retval EFI_INVALID_PARAMETER The parameter is invalid.
694 @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
695
696 **/
697 EFI_STATUS
698 EFIAPI
699 TlsGetKeyMaterial (
700 IN VOID *Tls,
701 IN OUT UINT8 *KeyMaterial
702 );
703
704 /**
705 Gets the CA Certificate from the cert store.
706
707 This function returns the CA certificate for the chosen
708 TLS connection.
709
710 @param[in] Tls Pointer to the TLS object.
711 @param[out] Data Pointer to the data buffer to receive the CA
712 certificate data sent to the client.
713 @param[in,out] DataSize The size of data buffer in bytes.
714
715 @retval EFI_SUCCESS The operation succeeded.
716 @retval EFI_UNSUPPORTED This function is not supported.
717 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
718
719 **/
720 EFI_STATUS
721 EFIAPI
722 TlsGetCaCertificate (
723 IN VOID *Tls,
724 OUT VOID *Data,
725 IN OUT UINTN *DataSize
726 );
727
728 /**
729 Gets the local public Certificate set in the specified TLS object.
730
731 This function returns the local public certificate which was currently set
732 in the specified TLS object.
733
734 @param[in] Tls Pointer to the TLS object.
735 @param[out] Data Pointer to the data buffer to receive the local
736 public certificate.
737 @param[in,out] DataSize The size of data buffer in bytes.
738
739 @retval EFI_SUCCESS The operation succeeded.
740 @retval EFI_INVALID_PARAMETER The parameter is invalid.
741 @retval EFI_NOT_FOUND The certificate is not found.
742 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
743
744 **/
745 EFI_STATUS
746 EFIAPI
747 TlsGetHostPublicCert (
748 IN VOID *Tls,
749 OUT VOID *Data,
750 IN OUT UINTN *DataSize
751 );
752
753 /**
754 Gets the local private key set in the specified TLS object.
755
756 This function returns the local private key data which was currently set
757 in the specified TLS object.
758
759 @param[in] Tls Pointer to the TLS object.
760 @param[out] Data Pointer to the data buffer to receive the local
761 private key data.
762 @param[in,out] DataSize The size of data buffer in bytes.
763
764 @retval EFI_SUCCESS The operation succeeded.
765 @retval EFI_UNSUPPORTED This function is not supported.
766 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
767
768 **/
769 EFI_STATUS
770 EFIAPI
771 TlsGetHostPrivateKey (
772 IN VOID *Tls,
773 OUT VOID *Data,
774 IN OUT UINTN *DataSize
775 );
776
777 /**
778 Gets the CA-supplied certificate revocation list data set in the specified
779 TLS object.
780
781 This function returns the CA-supplied certificate revocation list data which
782 was currently set in the specified TLS object.
783
784 @param[out] Data Pointer to the data buffer to receive the CRL data.
785 @param[in,out] DataSize The size of data buffer in bytes.
786
787 @retval EFI_SUCCESS The operation succeeded.
788 @retval EFI_UNSUPPORTED This function is not supported.
789 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
790
791 **/
792 EFI_STATUS
793 EFIAPI
794 TlsGetCertRevocationList (
795 OUT VOID *Data,
796 IN OUT UINTN *DataSize
797 );
798
799 #endif // __TLS_LIB_H__
800