]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Include/Library/TlsLib.h
CryptoPkg/TlsLib: Change the return type of TlsInitialize().
[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 Pointer to a string that contains one or more
352 ciphers separated by a colon.
353 @param[in] CipherNum The number of cipher in the list.
354
355 @retval EFI_SUCCESS The ciphers list was set successfully.
356 @retval EFI_INVALID_PARAMETER The parameter is invalid.
357 @retval EFI_UNSUPPORTED Unsupported TLS cipher in the list.
358
359 **/
360 EFI_STATUS
361 EFIAPI
362 TlsSetCipherList (
363 IN VOID *Tls,
364 IN UINT16 *CipherId,
365 IN UINTN CipherNum
366 );
367
368 /**
369 Set the compression method for TLS/SSL operations.
370
371 This function handles TLS/SSL integrated compression methods.
372
373 @param[in] CompMethod The compression method ID.
374
375 @retval EFI_SUCCESS The compression method for the communication was
376 set successfully.
377 @retval EFI_UNSUPPORTED Unsupported compression method.
378
379 **/
380 EFI_STATUS
381 EFIAPI
382 TlsSetCompressionMethod (
383 IN UINT8 CompMethod
384 );
385
386 /**
387 Set peer certificate verification mode for the TLS connection.
388
389 This function sets the verification mode flags for the TLS connection.
390
391 @param[in] Tls Pointer to the TLS object.
392 @param[in] VerifyMode A set of logically or'ed verification mode flags.
393
394 **/
395 VOID
396 EFIAPI
397 TlsSetVerify (
398 IN VOID *Tls,
399 IN UINT32 VerifyMode
400 );
401
402 /**
403 Sets a TLS/SSL session ID to be used during TLS/SSL connect.
404
405 This function sets a session ID to be used when the TLS/SSL connection is
406 to be established.
407
408 @param[in] Tls Pointer to the TLS object.
409 @param[in] SessionId Session ID data used for session resumption.
410 @param[in] SessionIdLen Length of Session ID in bytes.
411
412 @retval EFI_SUCCESS Session ID was set successfully.
413 @retval EFI_INVALID_PARAMETER The parameter is invalid.
414 @retval EFI_UNSUPPORTED No available session for ID setting.
415
416 **/
417 EFI_STATUS
418 EFIAPI
419 TlsSetSessionId (
420 IN VOID *Tls,
421 IN UINT8 *SessionId,
422 IN UINT16 SessionIdLen
423 );
424
425 /**
426 Adds the CA to the cert store when requesting Server or Client authentication.
427
428 This function adds the CA certificate to the list of CAs when requesting
429 Server or Client authentication for the chosen TLS connection.
430
431 @param[in] Tls Pointer to the TLS object.
432 @param[in] Data Pointer to the data buffer of a DER-encoded binary
433 X.509 certificate or PEM-encoded X.509 certificate.
434 @param[in] DataSize The size of data buffer in bytes.
435
436 @retval EFI_SUCCESS The operation succeeded.
437 @retval EFI_INVALID_PARAMETER The parameter is invalid.
438 @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
439 @retval EFI_ABORTED Invalid X.509 certificate.
440
441 **/
442 EFI_STATUS
443 EFIAPI
444 TlsSetCaCertificate (
445 IN VOID *Tls,
446 IN VOID *Data,
447 IN UINTN DataSize
448 );
449
450 /**
451 Loads the local public certificate into the specified TLS object.
452
453 This function loads the X.509 certificate into the specified TLS object
454 for TLS negotiation.
455
456 @param[in] Tls Pointer to the TLS object.
457 @param[in] Data Pointer to the data buffer of a DER-encoded binary
458 X.509 certificate or PEM-encoded X.509 certificate.
459 @param[in] DataSize The size of data buffer in bytes.
460
461 @retval EFI_SUCCESS The operation succeeded.
462 @retval EFI_INVALID_PARAMETER The parameter is invalid.
463 @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
464 @retval EFI_ABORTED Invalid X.509 certificate.
465
466 **/
467 EFI_STATUS
468 EFIAPI
469 TlsSetHostPublicCert (
470 IN VOID *Tls,
471 IN VOID *Data,
472 IN UINTN DataSize
473 );
474
475 /**
476 Adds the local private key to the specified TLS object.
477
478 This function adds the local private key (PEM-encoded RSA or PKCS#8 private
479 key) into the specified TLS object for TLS negotiation.
480
481 @param[in] Tls Pointer to the TLS object.
482 @param[in] Data Pointer to the data buffer of a PEM-encoded RSA
483 or PKCS#8 private key.
484 @param[in] DataSize The size of data buffer in bytes.
485
486 @retval EFI_SUCCESS The operation succeeded.
487 @retval EFI_UNSUPPORTED This function is not supported.
488 @retval EFI_ABORTED Invalid private key data.
489
490 **/
491 EFI_STATUS
492 EFIAPI
493 TlsSetHostPrivateKey (
494 IN VOID *Tls,
495 IN VOID *Data,
496 IN UINTN DataSize
497 );
498
499 /**
500 Adds the CA-supplied certificate revocation list for certificate validation.
501
502 This function adds the CA-supplied certificate revocation list data for
503 certificate validity checking.
504
505 @param[in] Data Pointer to the data buffer of a DER-encoded CRL data.
506 @param[in] DataSize The size of data buffer in bytes.
507
508 @retval EFI_SUCCESS The operation succeeded.
509 @retval EFI_UNSUPPORTED This function is not supported.
510 @retval EFI_ABORTED Invalid CRL data.
511
512 **/
513 EFI_STATUS
514 EFIAPI
515 TlsSetCertRevocationList (
516 IN VOID *Data,
517 IN UINTN DataSize
518 );
519
520 /**
521 Gets the protocol version used by the specified TLS connection.
522
523 This function returns the protocol version used by the specified TLS
524 connection.
525
526 @param[in] Tls Pointer to the TLS object.
527
528 @return The protocol version of the specified TLS connection.
529
530 **/
531 UINT16
532 EFIAPI
533 TlsGetVersion (
534 IN VOID *Tls
535 );
536
537 /**
538 Gets the connection end of the specified TLS connection.
539
540 This function returns the connection end (as client or as server) used by
541 the specified TLS connection.
542
543 @param[in] Tls Pointer to the TLS object.
544
545 @return The connection end used by the specified TLS connection.
546
547 **/
548 UINT8
549 EFIAPI
550 TlsGetConnectionEnd (
551 IN VOID *Tls
552 );
553
554 /**
555 Gets the cipher suite used by the specified TLS connection.
556
557 This function returns current cipher suite used by the specified
558 TLS connection.
559
560 @param[in] Tls Pointer to the TLS object.
561 @param[in,out] CipherId The cipher suite used by the TLS object.
562
563 @retval EFI_SUCCESS The cipher suite was returned successfully.
564 @retval EFI_INVALID_PARAMETER The parameter is invalid.
565 @retval EFI_UNSUPPORTED Unsupported cipher suite.
566
567 **/
568 EFI_STATUS
569 EFIAPI
570 TlsGetCurrentCipher (
571 IN VOID *Tls,
572 IN OUT UINT16 *CipherId
573 );
574
575 /**
576 Gets the compression methods used by the specified TLS connection.
577
578 This function returns current integrated compression methods used by
579 the specified TLS connection.
580
581 @param[in] Tls Pointer to the TLS object.
582 @param[in,out] CompressionId The current compression method used by
583 the TLS object.
584
585 @retval EFI_SUCCESS The compression method was returned successfully.
586 @retval EFI_INVALID_PARAMETER The parameter is invalid.
587 @retval EFI_ABORTED Invalid Compression method.
588 @retval EFI_UNSUPPORTED This function is not supported.
589
590 **/
591 EFI_STATUS
592 EFIAPI
593 TlsGetCurrentCompressionId (
594 IN VOID *Tls,
595 IN OUT UINT8 *CompressionId
596 );
597
598 /**
599 Gets the verification mode currently set in the TLS connection.
600
601 This function returns the peer verification mode currently set in the
602 specified TLS connection.
603
604 @param[in] Tls Pointer to the TLS object.
605
606 @return The verification mode set in the specified TLS connection.
607
608 **/
609 UINT32
610 EFIAPI
611 TlsGetVerify (
612 IN VOID *Tls
613 );
614
615 /**
616 Gets the session ID used by the specified TLS connection.
617
618 This function returns the TLS/SSL session ID currently used by the
619 specified TLS connection.
620
621 @param[in] Tls Pointer to the TLS object.
622 @param[in,out] SessionId Buffer to contain the returned session ID.
623 @param[in,out] SessionIdLen The length of Session ID in bytes.
624
625 @retval EFI_SUCCESS The Session ID was returned successfully.
626 @retval EFI_INVALID_PARAMETER The parameter is invalid.
627 @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
628
629 **/
630 EFI_STATUS
631 EFIAPI
632 TlsGetSessionId (
633 IN VOID *Tls,
634 IN OUT UINT8 *SessionId,
635 IN OUT UINT16 *SessionIdLen
636 );
637
638 /**
639 Gets the client random data used in the specified TLS connection.
640
641 This function returns the TLS/SSL client random data currently used in
642 the specified TLS connection.
643
644 @param[in] Tls Pointer to the TLS object.
645 @param[in,out] ClientRandom Buffer to contain the returned client
646 random data (32 bytes).
647
648 **/
649 VOID
650 EFIAPI
651 TlsGetClientRandom (
652 IN VOID *Tls,
653 IN OUT UINT8 *ClientRandom
654 );
655
656 /**
657 Gets the server random data used in the specified TLS connection.
658
659 This function returns the TLS/SSL server random data currently used in
660 the specified TLS connection.
661
662 @param[in] Tls Pointer to the TLS object.
663 @param[in,out] ServerRandom Buffer to contain the returned server
664 random data (32 bytes).
665
666 **/
667 VOID
668 EFIAPI
669 TlsGetServerRandom (
670 IN VOID *Tls,
671 IN OUT UINT8 *ServerRandom
672 );
673
674 /**
675 Gets the master key data used in the specified TLS connection.
676
677 This function returns the TLS/SSL master key material currently used in
678 the specified TLS connection.
679
680 @param[in] Tls Pointer to the TLS object.
681 @param[in,out] KeyMaterial Buffer to contain the returned key material.
682
683 @retval EFI_SUCCESS Key material was returned successfully.
684 @retval EFI_INVALID_PARAMETER The parameter is invalid.
685 @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
686
687 **/
688 EFI_STATUS
689 EFIAPI
690 TlsGetKeyMaterial (
691 IN VOID *Tls,
692 IN OUT UINT8 *KeyMaterial
693 );
694
695 /**
696 Gets the CA Certificate from the cert store.
697
698 This function returns the CA certificate for the chosen
699 TLS connection.
700
701 @param[in] Tls Pointer to the TLS object.
702 @param[out] Data Pointer to the data buffer to receive the CA
703 certificate data sent to the client.
704 @param[in,out] DataSize The size of data buffer in bytes.
705
706 @retval EFI_SUCCESS The operation succeeded.
707 @retval EFI_UNSUPPORTED This function is not supported.
708 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
709
710 **/
711 EFI_STATUS
712 EFIAPI
713 TlsGetCaCertificate (
714 IN VOID *Tls,
715 OUT VOID *Data,
716 IN OUT UINTN *DataSize
717 );
718
719 /**
720 Gets the local public Certificate set in the specified TLS object.
721
722 This function returns the local public certificate which was currently set
723 in the specified TLS object.
724
725 @param[in] Tls Pointer to the TLS object.
726 @param[out] Data Pointer to the data buffer to receive the local
727 public certificate.
728 @param[in,out] DataSize The size of data buffer in bytes.
729
730 @retval EFI_SUCCESS The operation succeeded.
731 @retval EFI_INVALID_PARAMETER The parameter is invalid.
732 @retval EFI_NOT_FOUND The certificate is not found.
733 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
734
735 **/
736 EFI_STATUS
737 EFIAPI
738 TlsGetHostPublicCert (
739 IN VOID *Tls,
740 OUT VOID *Data,
741 IN OUT UINTN *DataSize
742 );
743
744 /**
745 Gets the local private key set in the specified TLS object.
746
747 This function returns the local private key data which was currently set
748 in the specified TLS object.
749
750 @param[in] Tls Pointer to the TLS object.
751 @param[out] Data Pointer to the data buffer to receive the local
752 private key data.
753 @param[in,out] DataSize The size of data buffer in bytes.
754
755 @retval EFI_SUCCESS The operation succeeded.
756 @retval EFI_UNSUPPORTED This function is not supported.
757 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
758
759 **/
760 EFI_STATUS
761 EFIAPI
762 TlsGetHostPrivateKey (
763 IN VOID *Tls,
764 OUT VOID *Data,
765 IN OUT UINTN *DataSize
766 );
767
768 /**
769 Gets the CA-supplied certificate revocation list data set in the specified
770 TLS object.
771
772 This function returns the CA-supplied certificate revocation list data which
773 was currently set in the specified TLS object.
774
775 @param[out] Data Pointer to the data buffer to receive the CRL data.
776 @param[in,out] DataSize The size of data buffer in bytes.
777
778 @retval EFI_SUCCESS The operation succeeded.
779 @retval EFI_UNSUPPORTED This function is not supported.
780 @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
781
782 **/
783 EFI_STATUS
784 EFIAPI
785 TlsGetCertRevocationList (
786 OUT VOID *Data,
787 IN OUT UINTN *DataSize
788 );
789
790 #endif // __TLS_LIB_H__
791