summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c197
1 files changed, 196 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index f6c9406139..b1169b0242 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.310 2023/05/26 13:44:05 tb Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.311 2023/07/08 16:40:13 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -218,6 +218,7 @@ SSL_clear(SSL *s)
218 218
219 return (1); 219 return (1);
220} 220}
221LSSL_ALIAS(SSL_clear);
221 222
222/* Used to change an SSL_CTXs default SSL method type */ 223/* Used to change an SSL_CTXs default SSL method type */
223int 224int
@@ -236,6 +237,7 @@ SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth)
236 } 237 }
237 return (1); 238 return (1);
238} 239}
240LSSL_ALIAS(SSL_CTX_set_ssl_version);
239 241
240SSL * 242SSL *
241SSL_new(SSL_CTX *ctx) 243SSL_new(SSL_CTX *ctx)
@@ -360,6 +362,7 @@ SSL_new(SSL_CTX *ctx)
360 SSLerrorx(ERR_R_MALLOC_FAILURE); 362 SSLerrorx(ERR_R_MALLOC_FAILURE);
361 return (NULL); 363 return (NULL);
362} 364}
365LSSL_ALIAS(SSL_new);
363 366
364int 367int
365SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, 368SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,
@@ -374,6 +377,7 @@ SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,
374 377
375 return (1); 378 return (1);
376} 379}
380LSSL_ALIAS(SSL_CTX_set_session_id_context);
377 381
378int 382int
379SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, 383SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
@@ -388,6 +392,7 @@ SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
388 392
389 return (1); 393 return (1);
390} 394}
395LSSL_ALIAS(SSL_set_session_id_context);
391 396
392int 397int
393SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb) 398SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb)
@@ -397,6 +402,7 @@ SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb)
397 CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); 402 CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);
398 return (1); 403 return (1);
399} 404}
405LSSL_ALIAS(SSL_CTX_set_generate_session_id);
400 406
401int 407int
402SSL_set_generate_session_id(SSL *ssl, GEN_SESSION_CB cb) 408SSL_set_generate_session_id(SSL *ssl, GEN_SESSION_CB cb)
@@ -406,6 +412,7 @@ SSL_set_generate_session_id(SSL *ssl, GEN_SESSION_CB cb)
406 CRYPTO_w_unlock(CRYPTO_LOCK_SSL); 412 CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
407 return (1); 413 return (1);
408} 414}
415LSSL_ALIAS(SSL_set_generate_session_id);
409 416
410int 417int
411SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, 418SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
@@ -432,30 +439,35 @@ SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
432 CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX); 439 CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX);
433 return (p != NULL); 440 return (p != NULL);
434} 441}
442LSSL_ALIAS(SSL_has_matching_session_id);
435 443
436int 444int
437SSL_CTX_set_purpose(SSL_CTX *s, int purpose) 445SSL_CTX_set_purpose(SSL_CTX *s, int purpose)
438{ 446{
439 return (X509_VERIFY_PARAM_set_purpose(s->param, purpose)); 447 return (X509_VERIFY_PARAM_set_purpose(s->param, purpose));
440} 448}
449LSSL_ALIAS(SSL_CTX_set_purpose);
441 450
442int 451int
443SSL_set_purpose(SSL *s, int purpose) 452SSL_set_purpose(SSL *s, int purpose)
444{ 453{
445 return (X509_VERIFY_PARAM_set_purpose(s->param, purpose)); 454 return (X509_VERIFY_PARAM_set_purpose(s->param, purpose));
446} 455}
456LSSL_ALIAS(SSL_set_purpose);
447 457
448int 458int
449SSL_CTX_set_trust(SSL_CTX *s, int trust) 459SSL_CTX_set_trust(SSL_CTX *s, int trust)
450{ 460{
451 return (X509_VERIFY_PARAM_set_trust(s->param, trust)); 461 return (X509_VERIFY_PARAM_set_trust(s->param, trust));
452} 462}
463LSSL_ALIAS(SSL_CTX_set_trust);
453 464
454int 465int
455SSL_set_trust(SSL *s, int trust) 466SSL_set_trust(SSL *s, int trust)
456{ 467{
457 return (X509_VERIFY_PARAM_set_trust(s->param, trust)); 468 return (X509_VERIFY_PARAM_set_trust(s->param, trust));
458} 469}
470LSSL_ALIAS(SSL_set_trust);
459 471
460int 472int
461SSL_set1_host(SSL *s, const char *hostname) 473SSL_set1_host(SSL *s, const char *hostname)
@@ -470,42 +482,49 @@ SSL_set1_host(SSL *s, const char *hostname)
470 else 482 else
471 return X509_VERIFY_PARAM_set1_host(s->param, hostname, 0); 483 return X509_VERIFY_PARAM_set1_host(s->param, hostname, 0);
472} 484}
485LSSL_ALIAS(SSL_set1_host);
473 486
474void 487void
475SSL_set_hostflags(SSL *s, unsigned int flags) 488SSL_set_hostflags(SSL *s, unsigned int flags)
476{ 489{
477 X509_VERIFY_PARAM_set_hostflags(s->param, flags); 490 X509_VERIFY_PARAM_set_hostflags(s->param, flags);
478} 491}
492LSSL_ALIAS(SSL_set_hostflags);
479 493
480const char * 494const char *
481SSL_get0_peername(SSL *s) 495SSL_get0_peername(SSL *s)
482{ 496{
483 return X509_VERIFY_PARAM_get0_peername(s->param); 497 return X509_VERIFY_PARAM_get0_peername(s->param);
484} 498}
499LSSL_ALIAS(SSL_get0_peername);
485 500
486X509_VERIFY_PARAM * 501X509_VERIFY_PARAM *
487SSL_CTX_get0_param(SSL_CTX *ctx) 502SSL_CTX_get0_param(SSL_CTX *ctx)
488{ 503{
489 return (ctx->param); 504 return (ctx->param);
490} 505}
506LSSL_ALIAS(SSL_CTX_get0_param);
491 507
492int 508int
493SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm) 509SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm)
494{ 510{
495 return (X509_VERIFY_PARAM_set1(ctx->param, vpm)); 511 return (X509_VERIFY_PARAM_set1(ctx->param, vpm));
496} 512}
513LSSL_ALIAS(SSL_CTX_set1_param);
497 514
498X509_VERIFY_PARAM * 515X509_VERIFY_PARAM *
499SSL_get0_param(SSL *ssl) 516SSL_get0_param(SSL *ssl)
500{ 517{
501 return (ssl->param); 518 return (ssl->param);
502} 519}
520LSSL_ALIAS(SSL_get0_param);
503 521
504int 522int
505SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm) 523SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm)
506{ 524{
507 return (X509_VERIFY_PARAM_set1(ssl->param, vpm)); 525 return (X509_VERIFY_PARAM_set1(ssl->param, vpm));
508} 526}
527LSSL_ALIAS(SSL_set1_param);
509 528
510void 529void
511SSL_free(SSL *s) 530SSL_free(SSL *s)
@@ -585,6 +604,7 @@ SSL_free(SSL *s)
585 604
586 free(s); 605 free(s);
587} 606}
607LSSL_ALIAS(SSL_free);
588 608
589int 609int
590SSL_up_ref(SSL *s) 610SSL_up_ref(SSL *s)
@@ -592,6 +612,7 @@ SSL_up_ref(SSL *s)
592 int refs = CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL); 612 int refs = CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL);
593 return (refs > 1) ? 1 : 0; 613 return (refs > 1) ? 1 : 0;
594} 614}
615LSSL_ALIAS(SSL_up_ref);
595 616
596void 617void
597SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio) 618SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio)
@@ -611,12 +632,14 @@ SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio)
611 s->rbio = rbio; 632 s->rbio = rbio;
612 s->wbio = wbio; 633 s->wbio = wbio;
613} 634}
635LSSL_ALIAS(SSL_set_bio);
614 636
615BIO * 637BIO *
616SSL_get_rbio(const SSL *s) 638SSL_get_rbio(const SSL *s)
617{ 639{
618 return (s->rbio); 640 return (s->rbio);
619} 641}
642LSSL_ALIAS(SSL_get_rbio);
620 643
621void 644void
622SSL_set0_rbio(SSL *s, BIO *rbio) 645SSL_set0_rbio(SSL *s, BIO *rbio)
@@ -624,18 +647,21 @@ SSL_set0_rbio(SSL *s, BIO *rbio)
624 BIO_free_all(s->rbio); 647 BIO_free_all(s->rbio);
625 s->rbio = rbio; 648 s->rbio = rbio;
626} 649}
650LSSL_ALIAS(SSL_set0_rbio);
627 651
628BIO * 652BIO *
629SSL_get_wbio(const SSL *s) 653SSL_get_wbio(const SSL *s)
630{ 654{
631 return (s->wbio); 655 return (s->wbio);
632} 656}
657LSSL_ALIAS(SSL_get_wbio);
633 658
634int 659int
635SSL_get_fd(const SSL *s) 660SSL_get_fd(const SSL *s)
636{ 661{
637 return (SSL_get_rfd(s)); 662 return (SSL_get_rfd(s));
638} 663}
664LSSL_ALIAS(SSL_get_fd);
639 665
640int 666int
641SSL_get_rfd(const SSL *s) 667SSL_get_rfd(const SSL *s)
@@ -649,6 +675,7 @@ SSL_get_rfd(const SSL *s)
649 BIO_get_fd(r, &ret); 675 BIO_get_fd(r, &ret);
650 return (ret); 676 return (ret);
651} 677}
678LSSL_ALIAS(SSL_get_rfd);
652 679
653int 680int
654SSL_get_wfd(const SSL *s) 681SSL_get_wfd(const SSL *s)
@@ -662,6 +689,7 @@ SSL_get_wfd(const SSL *s)
662 BIO_get_fd(r, &ret); 689 BIO_get_fd(r, &ret);
663 return (ret); 690 return (ret);
664} 691}
692LSSL_ALIAS(SSL_get_wfd);
665 693
666int 694int
667SSL_set_fd(SSL *s, int fd) 695SSL_set_fd(SSL *s, int fd)
@@ -681,6 +709,7 @@ SSL_set_fd(SSL *s, int fd)
681 err: 709 err:
682 return (ret); 710 return (ret);
683} 711}
712LSSL_ALIAS(SSL_set_fd);
684 713
685int 714int
686SSL_set_wfd(SSL *s, int fd) 715SSL_set_wfd(SSL *s, int fd)
@@ -704,6 +733,7 @@ SSL_set_wfd(SSL *s, int fd)
704 err: 733 err:
705 return (ret); 734 return (ret);
706} 735}
736LSSL_ALIAS(SSL_set_wfd);
707 737
708int 738int
709SSL_set_rfd(SSL *s, int fd) 739SSL_set_rfd(SSL *s, int fd)
@@ -727,6 +757,7 @@ SSL_set_rfd(SSL *s, int fd)
727 err: 757 err:
728 return (ret); 758 return (ret);
729} 759}
760LSSL_ALIAS(SSL_set_rfd);
730 761
731 762
732/* return length of latest Finished message we sent, copy to 'buf' */ 763/* return length of latest Finished message we sent, copy to 'buf' */
@@ -741,6 +772,7 @@ SSL_get_finished(const SSL *s, void *buf, size_t count)
741 memcpy(buf, s->s3->hs.finished, count); 772 memcpy(buf, s->s3->hs.finished, count);
742 return (ret); 773 return (ret);
743} 774}
775LSSL_ALIAS(SSL_get_finished);
744 776
745/* return length of latest Finished message we expected, copy to 'buf' */ 777/* return length of latest Finished message we expected, copy to 'buf' */
746size_t 778size_t
@@ -754,6 +786,7 @@ SSL_get_peer_finished(const SSL *s, void *buf, size_t count)
754 memcpy(buf, s->s3->hs.peer_finished, count); 786 memcpy(buf, s->s3->hs.peer_finished, count);
755 return (ret); 787 return (ret);
756} 788}
789LSSL_ALIAS(SSL_get_peer_finished);
757 790
758 791
759int 792int
@@ -761,30 +794,35 @@ SSL_get_verify_mode(const SSL *s)
761{ 794{
762 return (s->verify_mode); 795 return (s->verify_mode);
763} 796}
797LSSL_ALIAS(SSL_get_verify_mode);
764 798
765int 799int
766SSL_get_verify_depth(const SSL *s) 800SSL_get_verify_depth(const SSL *s)
767{ 801{
768 return (X509_VERIFY_PARAM_get_depth(s->param)); 802 return (X509_VERIFY_PARAM_get_depth(s->param));
769} 803}
804LSSL_ALIAS(SSL_get_verify_depth);
770 805
771int 806int
772(*SSL_get_verify_callback(const SSL *s))(int, X509_STORE_CTX *) 807(*SSL_get_verify_callback(const SSL *s))(int, X509_STORE_CTX *)
773{ 808{
774 return (s->verify_callback); 809 return (s->verify_callback);
775} 810}
811LSSL_ALIAS(SSL_get_verify_callback);
776 812
777void 813void
778SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb) 814SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb)
779{ 815{
780 ctx->keylog_callback = cb; 816 ctx->keylog_callback = cb;
781} 817}
818LSSL_ALIAS(SSL_CTX_set_keylog_callback);
782 819
783SSL_CTX_keylog_cb_func 820SSL_CTX_keylog_cb_func
784SSL_CTX_get_keylog_callback(const SSL_CTX *ctx) 821SSL_CTX_get_keylog_callback(const SSL_CTX *ctx)
785{ 822{
786 return (ctx->keylog_callback); 823 return (ctx->keylog_callback);
787} 824}
825LSSL_ALIAS(SSL_CTX_get_keylog_callback);
788 826
789int 827int
790SSL_set_num_tickets(SSL *s, size_t num_tickets) 828SSL_set_num_tickets(SSL *s, size_t num_tickets)
@@ -793,12 +831,14 @@ SSL_set_num_tickets(SSL *s, size_t num_tickets)
793 831
794 return 1; 832 return 1;
795} 833}
834LSSL_ALIAS(SSL_set_num_tickets);
796 835
797size_t 836size_t
798SSL_get_num_tickets(const SSL *s) 837SSL_get_num_tickets(const SSL *s)
799{ 838{
800 return s->num_tickets; 839 return s->num_tickets;
801} 840}
841LSSL_ALIAS(SSL_get_num_tickets);
802 842
803int 843int
804SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets) 844SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets)
@@ -807,30 +847,35 @@ SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets)
807 847
808 return 1; 848 return 1;
809} 849}
850LSSL_ALIAS(SSL_CTX_set_num_tickets);
810 851
811size_t 852size_t
812SSL_CTX_get_num_tickets(const SSL_CTX *ctx) 853SSL_CTX_get_num_tickets(const SSL_CTX *ctx)
813{ 854{
814 return ctx->num_tickets; 855 return ctx->num_tickets;
815} 856}
857LSSL_ALIAS(SSL_CTX_get_num_tickets);
816 858
817int 859int
818SSL_CTX_get_verify_mode(const SSL_CTX *ctx) 860SSL_CTX_get_verify_mode(const SSL_CTX *ctx)
819{ 861{
820 return (ctx->verify_mode); 862 return (ctx->verify_mode);
821} 863}
864LSSL_ALIAS(SSL_CTX_get_verify_mode);
822 865
823int 866int
824SSL_CTX_get_verify_depth(const SSL_CTX *ctx) 867SSL_CTX_get_verify_depth(const SSL_CTX *ctx)
825{ 868{
826 return (X509_VERIFY_PARAM_get_depth(ctx->param)); 869 return (X509_VERIFY_PARAM_get_depth(ctx->param));
827} 870}
871LSSL_ALIAS(SSL_CTX_get_verify_depth);
828 872
829int 873int
830(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *) 874(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *)
831{ 875{
832 return (ctx->default_verify_callback); 876 return (ctx->default_verify_callback);
833} 877}
878LSSL_ALIAS(SSL_CTX_get_verify_callback);
834 879
835void 880void
836SSL_set_verify(SSL *s, int mode, 881SSL_set_verify(SSL *s, int mode,
@@ -840,30 +885,35 @@ SSL_set_verify(SSL *s, int mode,
840 if (callback != NULL) 885 if (callback != NULL)
841 s->verify_callback = callback; 886 s->verify_callback = callback;
842} 887}
888LSSL_ALIAS(SSL_set_verify);
843 889
844void 890void
845SSL_set_verify_depth(SSL *s, int depth) 891SSL_set_verify_depth(SSL *s, int depth)
846{ 892{
847 X509_VERIFY_PARAM_set_depth(s->param, depth); 893 X509_VERIFY_PARAM_set_depth(s->param, depth);
848} 894}
895LSSL_ALIAS(SSL_set_verify_depth);
849 896
850void 897void
851SSL_set_read_ahead(SSL *s, int yes) 898SSL_set_read_ahead(SSL *s, int yes)
852{ 899{
853 s->read_ahead = yes; 900 s->read_ahead = yes;
854} 901}
902LSSL_ALIAS(SSL_set_read_ahead);
855 903
856int 904int
857SSL_get_read_ahead(const SSL *s) 905SSL_get_read_ahead(const SSL *s)
858{ 906{
859 return (s->read_ahead); 907 return (s->read_ahead);
860} 908}
909LSSL_ALIAS(SSL_get_read_ahead);
861 910
862int 911int
863SSL_pending(const SSL *s) 912SSL_pending(const SSL *s)
864{ 913{
865 return (s->method->ssl_pending(s)); 914 return (s->method->ssl_pending(s));
866} 915}
916LSSL_ALIAS(SSL_pending);
867 917
868X509 * 918X509 *
869SSL_get_peer_certificate(const SSL *s) 919SSL_get_peer_certificate(const SSL *s)
@@ -880,6 +930,7 @@ SSL_get_peer_certificate(const SSL *s)
880 930
881 return cert; 931 return cert;
882} 932}
933LSSL_ALIAS(SSL_get_peer_certificate);
883 934
884STACK_OF(X509) * 935STACK_OF(X509) *
885SSL_get_peer_cert_chain(const SSL *s) 936SSL_get_peer_cert_chain(const SSL *s)
@@ -896,6 +947,7 @@ SSL_get_peer_cert_chain(const SSL *s)
896 947
897 return s->s3->hs.peer_certs_no_leaf; 948 return s->s3->hs.peer_certs_no_leaf;
898} 949}
950LSSL_ALIAS(SSL_get_peer_cert_chain);
899 951
900STACK_OF(X509) * 952STACK_OF(X509) *
901SSL_get0_verified_chain(const SSL *s) 953SSL_get0_verified_chain(const SSL *s)
@@ -904,6 +956,7 @@ SSL_get0_verified_chain(const SSL *s)
904 return NULL; 956 return NULL;
905 return s->s3->hs.verified_chain; 957 return s->s3->hs.verified_chain;
906} 958}
959LSSL_ALIAS(SSL_get0_verified_chain);
907 960
908/* 961/*
909 * Now in theory, since the calling process own 't' it should be safe to 962 * Now in theory, since the calling process own 't' it should be safe to
@@ -939,6 +992,7 @@ SSL_copy_session_id(SSL *t, const SSL *f)
939 992
940 return 1; 993 return 1;
941} 994}
995LSSL_ALIAS(SSL_copy_session_id);
942 996
943/* Fix this so it checks all the valid key/cert options */ 997/* Fix this so it checks all the valid key/cert options */
944int 998int
@@ -956,6 +1010,7 @@ SSL_CTX_check_private_key(const SSL_CTX *ctx)
956 return (X509_check_private_key(ctx->cert->key->x509, 1010 return (X509_check_private_key(ctx->cert->key->x509,
957 ctx->cert->key->privatekey)); 1011 ctx->cert->key->privatekey));
958} 1012}
1013LSSL_ALIAS(SSL_CTX_check_private_key);
959 1014
960/* Fix this function so that it takes an optional type parameter */ 1015/* Fix this function so that it takes an optional type parameter */
961int 1016int
@@ -980,6 +1035,7 @@ SSL_check_private_key(const SSL *ssl)
980 return (X509_check_private_key(ssl->cert->key->x509, 1035 return (X509_check_private_key(ssl->cert->key->x509,
981 ssl->cert->key->privatekey)); 1036 ssl->cert->key->privatekey));
982} 1037}
1038LSSL_ALIAS(SSL_check_private_key);
983 1039
984int 1040int
985SSL_accept(SSL *s) 1041SSL_accept(SSL *s)
@@ -989,6 +1045,7 @@ SSL_accept(SSL *s)
989 1045
990 return (s->method->ssl_accept(s)); 1046 return (s->method->ssl_accept(s));
991} 1047}
1048LSSL_ALIAS(SSL_accept);
992 1049
993int 1050int
994SSL_connect(SSL *s) 1051SSL_connect(SSL *s)
@@ -998,18 +1055,21 @@ SSL_connect(SSL *s)
998 1055
999 return (s->method->ssl_connect(s)); 1056 return (s->method->ssl_connect(s));
1000} 1057}
1058LSSL_ALIAS(SSL_connect);
1001 1059
1002int 1060int
1003SSL_is_dtls(const SSL *s) 1061SSL_is_dtls(const SSL *s)
1004{ 1062{
1005 return s->method->dtls; 1063 return s->method->dtls;
1006} 1064}
1065LSSL_ALIAS(SSL_is_dtls);
1007 1066
1008int 1067int
1009SSL_is_server(const SSL *s) 1068SSL_is_server(const SSL *s)
1010{ 1069{
1011 return s->server; 1070 return s->server;
1012} 1071}
1072LSSL_ALIAS(SSL_is_server);
1013 1073
1014static long 1074static long
1015ssl_get_default_timeout() 1075ssl_get_default_timeout()
@@ -1026,6 +1086,7 @@ SSL_get_default_timeout(const SSL *s)
1026{ 1086{
1027 return (ssl_get_default_timeout()); 1087 return (ssl_get_default_timeout());
1028} 1088}
1089LSSL_ALIAS(SSL_get_default_timeout);
1029 1090
1030int 1091int
1031SSL_read(SSL *s, void *buf, int num) 1092SSL_read(SSL *s, void *buf, int num)
@@ -1051,6 +1112,7 @@ SSL_read(SSL *s, void *buf, int num)
1051 } 1112 }
1052 return ssl3_read(s, buf, num); 1113 return ssl3_read(s, buf, num);
1053} 1114}
1115LSSL_ALIAS(SSL_read);
1054 1116
1055int 1117int
1056SSL_read_ex(SSL *s, void *buf, size_t num, size_t *bytes_read) 1118SSL_read_ex(SSL *s, void *buf, size_t num, size_t *bytes_read)
@@ -1070,6 +1132,7 @@ SSL_read_ex(SSL *s, void *buf, size_t num, size_t *bytes_read)
1070 1132
1071 return ret > 0; 1133 return ret > 0;
1072} 1134}
1135LSSL_ALIAS(SSL_read_ex);
1073 1136
1074int 1137int
1075SSL_peek(SSL *s, void *buf, int num) 1138SSL_peek(SSL *s, void *buf, int num)
@@ -1094,6 +1157,7 @@ SSL_peek(SSL *s, void *buf, int num)
1094 } 1157 }
1095 return ssl3_peek(s, buf, num); 1158 return ssl3_peek(s, buf, num);
1096} 1159}
1160LSSL_ALIAS(SSL_peek);
1097 1161
1098int 1162int
1099SSL_peek_ex(SSL *s, void *buf, size_t num, size_t *bytes_peeked) 1163SSL_peek_ex(SSL *s, void *buf, size_t num, size_t *bytes_peeked)
@@ -1113,6 +1177,7 @@ SSL_peek_ex(SSL *s, void *buf, size_t num, size_t *bytes_peeked)
1113 1177
1114 return ret > 0; 1178 return ret > 0;
1115} 1179}
1180LSSL_ALIAS(SSL_peek_ex);
1116 1181
1117int 1182int
1118SSL_write(SSL *s, const void *buf, int num) 1183SSL_write(SSL *s, const void *buf, int num)
@@ -1139,6 +1204,7 @@ SSL_write(SSL *s, const void *buf, int num)
1139 } 1204 }
1140 return ssl3_write(s, buf, num); 1205 return ssl3_write(s, buf, num);
1141} 1206}
1207LSSL_ALIAS(SSL_write);
1142 1208
1143int 1209int
1144SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *bytes_written) 1210SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *bytes_written)
@@ -1164,36 +1230,42 @@ SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *bytes_written)
1164 1230
1165 return ret > 0; 1231 return ret > 0;
1166} 1232}
1233LSSL_ALIAS(SSL_write_ex);
1167 1234
1168uint32_t 1235uint32_t
1169SSL_CTX_get_max_early_data(const SSL_CTX *ctx) 1236SSL_CTX_get_max_early_data(const SSL_CTX *ctx)
1170{ 1237{
1171 return 0; 1238 return 0;
1172} 1239}
1240LSSL_ALIAS(SSL_CTX_get_max_early_data);
1173 1241
1174int 1242int
1175SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data) 1243SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data)
1176{ 1244{
1177 return 1; 1245 return 1;
1178} 1246}
1247LSSL_ALIAS(SSL_CTX_set_max_early_data);
1179 1248
1180uint32_t 1249uint32_t
1181SSL_get_max_early_data(const SSL *s) 1250SSL_get_max_early_data(const SSL *s)
1182{ 1251{
1183 return 0; 1252 return 0;
1184} 1253}
1254LSSL_ALIAS(SSL_get_max_early_data);
1185 1255
1186int 1256int
1187SSL_set_max_early_data(SSL *s, uint32_t max_early_data) 1257SSL_set_max_early_data(SSL *s, uint32_t max_early_data)
1188{ 1258{
1189 return 1; 1259 return 1;
1190} 1260}
1261LSSL_ALIAS(SSL_set_max_early_data);
1191 1262
1192int 1263int
1193SSL_get_early_data_status(const SSL *s) 1264SSL_get_early_data_status(const SSL *s)
1194{ 1265{
1195 return SSL_EARLY_DATA_REJECTED; 1266 return SSL_EARLY_DATA_REJECTED;
1196} 1267}
1268LSSL_ALIAS(SSL_get_early_data_status);
1197 1269
1198int 1270int
1199SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes) 1271SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes)
@@ -1207,6 +1279,7 @@ SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes)
1207 1279
1208 return SSL_READ_EARLY_DATA_FINISH; 1280 return SSL_READ_EARLY_DATA_FINISH;
1209} 1281}
1282LSSL_ALIAS(SSL_read_early_data);
1210 1283
1211int 1284int
1212SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written) 1285SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written)
@@ -1215,6 +1288,7 @@ SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written)
1215 SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 1288 SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
1216 return 0; 1289 return 0;
1217} 1290}
1291LSSL_ALIAS(SSL_write_early_data);
1218 1292
1219int 1293int
1220SSL_shutdown(SSL *s) 1294SSL_shutdown(SSL *s)
@@ -1236,6 +1310,7 @@ SSL_shutdown(SSL *s)
1236 1310
1237 return (1); 1311 return (1);
1238} 1312}
1313LSSL_ALIAS(SSL_shutdown);
1239 1314
1240int 1315int
1241SSL_renegotiate(SSL *s) 1316SSL_renegotiate(SSL *s)
@@ -1247,6 +1322,7 @@ SSL_renegotiate(SSL *s)
1247 1322
1248 return (s->method->ssl_renegotiate(s)); 1323 return (s->method->ssl_renegotiate(s));
1249} 1324}
1325LSSL_ALIAS(SSL_renegotiate);
1250 1326
1251int 1327int
1252SSL_renegotiate_abbreviated(SSL *s) 1328SSL_renegotiate_abbreviated(SSL *s)
@@ -1258,6 +1334,7 @@ SSL_renegotiate_abbreviated(SSL *s)
1258 1334
1259 return (s->method->ssl_renegotiate(s)); 1335 return (s->method->ssl_renegotiate(s));
1260} 1336}
1337LSSL_ALIAS(SSL_renegotiate_abbreviated);
1261 1338
1262int 1339int
1263SSL_renegotiate_pending(SSL *s) 1340SSL_renegotiate_pending(SSL *s)
@@ -1268,6 +1345,7 @@ SSL_renegotiate_pending(SSL *s)
1268 */ 1345 */
1269 return (s->renegotiate != 0); 1346 return (s->renegotiate != 0);
1270} 1347}
1348LSSL_ALIAS(SSL_renegotiate_pending);
1271 1349
1272long 1350long
1273SSL_ctrl(SSL *s, int cmd, long larg, void *parg) 1351SSL_ctrl(SSL *s, int cmd, long larg, void *parg)
@@ -1325,6 +1403,7 @@ SSL_ctrl(SSL *s, int cmd, long larg, void *parg)
1325 return ssl3_ctrl(s, cmd, larg, parg); 1403 return ssl3_ctrl(s, cmd, larg, parg);
1326 } 1404 }
1327} 1405}
1406LSSL_ALIAS(SSL_ctrl);
1328 1407
1329long 1408long
1330SSL_callback_ctrl(SSL *s, int cmd, void (*fp)(void)) 1409SSL_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
@@ -1338,12 +1417,14 @@ SSL_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
1338 return (ssl3_callback_ctrl(s, cmd, fp)); 1417 return (ssl3_callback_ctrl(s, cmd, fp));
1339 } 1418 }
1340} 1419}
1420LSSL_ALIAS(SSL_callback_ctrl);
1341 1421
1342struct lhash_st_SSL_SESSION * 1422struct lhash_st_SSL_SESSION *
1343SSL_CTX_sessions(SSL_CTX *ctx) 1423SSL_CTX_sessions(SSL_CTX *ctx)
1344{ 1424{
1345 return (ctx->sessions); 1425 return (ctx->sessions);
1346} 1426}
1427LSSL_ALIAS(SSL_CTX_sessions);
1347 1428
1348long 1429long
1349SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) 1430SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
@@ -1423,6 +1504,7 @@ SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
1423 return (ssl3_ctx_ctrl(ctx, cmd, larg, parg)); 1504 return (ssl3_ctx_ctrl(ctx, cmd, larg, parg));
1424 } 1505 }
1425} 1506}
1507LSSL_ALIAS(SSL_CTX_ctrl);
1426 1508
1427long 1509long
1428SSL_CTX_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) 1510SSL_CTX_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
@@ -1436,6 +1518,7 @@ SSL_CTX_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
1436 return (ssl3_ctx_callback_ctrl(ctx, cmd, fp)); 1518 return (ssl3_ctx_callback_ctrl(ctx, cmd, fp));
1437 } 1519 }
1438} 1520}
1521LSSL_ALIAS(SSL_CTX_callback_ctrl);
1439 1522
1440int 1523int
1441ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b) 1524ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b)
@@ -1459,6 +1542,7 @@ SSL_get_ciphers(const SSL *s)
1459 1542
1460 return (s->ctx->cipher_list); 1543 return (s->ctx->cipher_list);
1461} 1544}
1545LSSL_ALIAS(SSL_get_ciphers);
1462 1546
1463STACK_OF(SSL_CIPHER) * 1547STACK_OF(SSL_CIPHER) *
1464SSL_get_client_ciphers(const SSL *s) 1548SSL_get_client_ciphers(const SSL *s)
@@ -1467,6 +1551,7 @@ SSL_get_client_ciphers(const SSL *s)
1467 return NULL; 1551 return NULL;
1468 return s->session->ciphers; 1552 return s->session->ciphers;
1469} 1553}
1554LSSL_ALIAS(SSL_get_client_ciphers);
1470 1555
1471STACK_OF(SSL_CIPHER) * 1556STACK_OF(SSL_CIPHER) *
1472SSL_get1_supported_ciphers(SSL *s) 1557SSL_get1_supported_ciphers(SSL *s)
@@ -1504,6 +1589,7 @@ SSL_get1_supported_ciphers(SSL *s)
1504 sk_SSL_CIPHER_free(supported_ciphers); 1589 sk_SSL_CIPHER_free(supported_ciphers);
1505 return NULL; 1590 return NULL;
1506} 1591}
1592LSSL_ALIAS(SSL_get1_supported_ciphers);
1507 1593
1508/* See if we have any ECC cipher suites. */ 1594/* See if we have any ECC cipher suites. */
1509int 1595int
@@ -1544,6 +1630,7 @@ SSL_get_cipher_list(const SSL *s, int n)
1544 1630
1545 return (cipher->name); 1631 return (cipher->name);
1546} 1632}
1633LSSL_ALIAS(SSL_get_cipher_list);
1547 1634
1548STACK_OF(SSL_CIPHER) * 1635STACK_OF(SSL_CIPHER) *
1549SSL_CTX_get_ciphers(const SSL_CTX *ctx) 1636SSL_CTX_get_ciphers(const SSL_CTX *ctx)
@@ -1552,6 +1639,7 @@ SSL_CTX_get_ciphers(const SSL_CTX *ctx)
1552 return NULL; 1639 return NULL;
1553 return ctx->cipher_list; 1640 return ctx->cipher_list;
1554} 1641}
1642LSSL_ALIAS(SSL_CTX_get_ciphers);
1555 1643
1556/* Specify the ciphers to be used by default by the SSL_CTX. */ 1644/* Specify the ciphers to be used by default by the SSL_CTX. */
1557int 1645int
@@ -1576,6 +1664,7 @@ SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
1576 } 1664 }
1577 return (1); 1665 return (1);
1578} 1666}
1667LSSL_ALIAS(SSL_CTX_set_cipher_list);
1579 1668
1580int 1669int
1581SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str) 1670SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str)
@@ -1590,6 +1679,7 @@ SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str)
1590 1679
1591 return 1; 1680 return 1;
1592} 1681}
1682LSSL_ALIAS(SSL_CTX_set_ciphersuites);
1593 1683
1594/* Specify the ciphers to be used by the SSL. */ 1684/* Specify the ciphers to be used by the SSL. */
1595int 1685int
@@ -1611,6 +1701,7 @@ SSL_set_cipher_list(SSL *s, const char *str)
1611 } 1701 }
1612 return (1); 1702 return (1);
1613} 1703}
1704LSSL_ALIAS(SSL_set_cipher_list);
1614 1705
1615int 1706int
1616SSL_set_ciphersuites(SSL *s, const char *str) 1707SSL_set_ciphersuites(SSL *s, const char *str)
@@ -1630,6 +1721,7 @@ SSL_set_ciphersuites(SSL *s, const char *str)
1630 1721
1631 return 1; 1722 return 1;
1632} 1723}
1724LSSL_ALIAS(SSL_set_ciphersuites);
1633 1725
1634char * 1726char *
1635SSL_get_shared_ciphers(const SSL *s, char *buf, int len) 1727SSL_get_shared_ciphers(const SSL *s, char *buf, int len)
@@ -1671,6 +1763,7 @@ SSL_get_shared_ciphers(const SSL *s, char *buf, int len)
1671 *end = '\0'; 1763 *end = '\0';
1672 return buf; 1764 return buf;
1673} 1765}
1766LSSL_ALIAS(SSL_get_shared_ciphers);
1674 1767
1675/* 1768/*
1676 * Return a servername extension value if provided in Client Hello, or NULL. 1769 * Return a servername extension value if provided in Client Hello, or NULL.
@@ -1686,6 +1779,7 @@ SSL_get_servername(const SSL *s, const int type)
1686 s->session->tlsext_hostname : 1779 s->session->tlsext_hostname :
1687 s->tlsext_hostname); 1780 s->tlsext_hostname);
1688} 1781}
1782LSSL_ALIAS(SSL_get_servername);
1689 1783
1690int 1784int
1691SSL_get_servername_type(const SSL *s) 1785SSL_get_servername_type(const SSL *s)
@@ -1696,6 +1790,7 @@ SSL_get_servername_type(const SSL *s)
1696 return (TLSEXT_NAMETYPE_host_name); 1790 return (TLSEXT_NAMETYPE_host_name);
1697 return (-1); 1791 return (-1);
1698} 1792}
1793LSSL_ALIAS(SSL_get_servername_type);
1699 1794
1700/* 1795/*
1701 * SSL_select_next_proto implements standard protocol selection. It is 1796 * SSL_select_next_proto implements standard protocol selection. It is
@@ -1749,6 +1844,7 @@ SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
1749 *outlen = result[0]; 1844 *outlen = result[0];
1750 return (status); 1845 return (status);
1751} 1846}
1847LSSL_ALIAS(SSL_select_next_proto);
1752 1848
1753/* SSL_get0_next_proto_negotiated is deprecated. */ 1849/* SSL_get0_next_proto_negotiated is deprecated. */
1754void 1850void
@@ -1758,6 +1854,7 @@ SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
1758 *data = NULL; 1854 *data = NULL;
1759 *len = 0; 1855 *len = 0;
1760} 1856}
1857LSSL_ALIAS(SSL_get0_next_proto_negotiated);
1761 1858
1762/* SSL_CTX_set_next_protos_advertised_cb is deprecated. */ 1859/* SSL_CTX_set_next_protos_advertised_cb is deprecated. */
1763void 1860void
@@ -1765,6 +1862,7 @@ SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *ctx, int (*cb) (SSL *ssl,
1765 const unsigned char **out, unsigned int *outlen, void *arg), void *arg) 1862 const unsigned char **out, unsigned int *outlen, void *arg), void *arg)
1766{ 1863{
1767} 1864}
1865LSSL_ALIAS(SSL_CTX_set_next_protos_advertised_cb);
1768 1866
1769/* SSL_CTX_set_next_proto_select_cb is deprecated. */ 1867/* SSL_CTX_set_next_proto_select_cb is deprecated. */
1770void 1868void
@@ -1773,6 +1871,7 @@ SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, int (*cb) (SSL *s,
1773 unsigned int inlen, void *arg), void *arg) 1871 unsigned int inlen, void *arg), void *arg)
1774{ 1872{
1775} 1873}
1874LSSL_ALIAS(SSL_CTX_set_next_proto_select_cb);
1776 1875
1777/* 1876/*
1778 * SSL_CTX_set_alpn_protos sets the ALPN protocol list to the specified 1877 * SSL_CTX_set_alpn_protos sets the ALPN protocol list to the specified
@@ -1806,6 +1905,7 @@ SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
1806 /* NOTE: Return values are the reverse of what you expect. */ 1905 /* NOTE: Return values are the reverse of what you expect. */
1807 return failed; 1906 return failed;
1808} 1907}
1908LSSL_ALIAS(SSL_CTX_set_alpn_protos);
1809 1909
1810/* 1910/*
1811 * SSL_set_alpn_protos sets the ALPN protocol list to the specified 1911 * SSL_set_alpn_protos sets the ALPN protocol list to the specified
@@ -1839,6 +1939,7 @@ SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,
1839 /* NOTE: Return values are the reverse of what you expect. */ 1939 /* NOTE: Return values are the reverse of what you expect. */
1840 return failed; 1940 return failed;
1841} 1941}
1942LSSL_ALIAS(SSL_set_alpn_protos);
1842 1943
1843/* 1944/*
1844 * SSL_CTX_set_alpn_select_cb sets a callback function that is called during 1945 * SSL_CTX_set_alpn_select_cb sets a callback function that is called during
@@ -1853,6 +1954,7 @@ SSL_CTX_set_alpn_select_cb(SSL_CTX* ctx,
1853 ctx->alpn_select_cb = cb; 1954 ctx->alpn_select_cb = cb;
1854 ctx->alpn_select_cb_arg = arg; 1955 ctx->alpn_select_cb_arg = arg;
1855} 1956}
1957LSSL_ALIAS(SSL_CTX_set_alpn_select_cb);
1856 1958
1857/* 1959/*
1858 * SSL_get0_alpn_selected gets the selected ALPN protocol (if any). On return 1960 * SSL_get0_alpn_selected gets the selected ALPN protocol (if any). On return
@@ -1867,12 +1969,14 @@ SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
1867 *data = ssl->s3->alpn_selected; 1969 *data = ssl->s3->alpn_selected;
1868 *len = ssl->s3->alpn_selected_len; 1970 *len = ssl->s3->alpn_selected_len;
1869} 1971}
1972LSSL_ALIAS(SSL_get0_alpn_selected);
1870 1973
1871void 1974void
1872SSL_set_psk_use_session_callback(SSL *s, SSL_psk_use_session_cb_func cb) 1975SSL_set_psk_use_session_callback(SSL *s, SSL_psk_use_session_cb_func cb)
1873{ 1976{
1874 return; 1977 return;
1875} 1978}
1979LSSL_ALIAS(SSL_set_psk_use_session_callback);
1876 1980
1877int 1981int
1878SSL_export_keying_material(SSL *s, unsigned char *out, size_t out_len, 1982SSL_export_keying_material(SSL *s, unsigned char *out, size_t out_len,
@@ -1891,6 +1995,7 @@ SSL_export_keying_material(SSL *s, unsigned char *out, size_t out_len,
1891 return tls12_exporter(s, label, label_len, context, context_len, 1995 return tls12_exporter(s, label, label_len, context, context_len,
1892 use_context, out, out_len); 1996 use_context, out, out_len);
1893} 1997}
1998LSSL_ALIAS(SSL_export_keying_material);
1894 1999
1895static unsigned long 2000static unsigned long
1896ssl_session_hash(const SSL_SESSION *a) 2001ssl_session_hash(const SSL_SESSION *a)
@@ -2092,6 +2197,7 @@ SSL_CTX_new(const SSL_METHOD *meth)
2092 SSL_CTX_free(ret); 2197 SSL_CTX_free(ret);
2093 return (NULL); 2198 return (NULL);
2094} 2199}
2200LSSL_ALIAS(SSL_CTX_new);
2095 2201
2096void 2202void
2097SSL_CTX_free(SSL_CTX *ctx) 2203SSL_CTX_free(SSL_CTX *ctx)
@@ -2146,6 +2252,7 @@ SSL_CTX_free(SSL_CTX *ctx)
2146 2252
2147 free(ctx); 2253 free(ctx);
2148} 2254}
2255LSSL_ALIAS(SSL_CTX_free);
2149 2256
2150int 2257int
2151SSL_CTX_up_ref(SSL_CTX *ctx) 2258SSL_CTX_up_ref(SSL_CTX *ctx)
@@ -2153,30 +2260,35 @@ SSL_CTX_up_ref(SSL_CTX *ctx)
2153 int refs = CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX); 2260 int refs = CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
2154 return ((refs > 1) ? 1 : 0); 2261 return ((refs > 1) ? 1 : 0);
2155} 2262}
2263LSSL_ALIAS(SSL_CTX_up_ref);
2156 2264
2157pem_password_cb * 2265pem_password_cb *
2158SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx) 2266SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
2159{ 2267{
2160 return (ctx->default_passwd_callback); 2268 return (ctx->default_passwd_callback);
2161} 2269}
2270LSSL_ALIAS(SSL_CTX_get_default_passwd_cb);
2162 2271
2163void 2272void
2164SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb) 2273SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb)
2165{ 2274{
2166 ctx->default_passwd_callback = cb; 2275 ctx->default_passwd_callback = cb;
2167} 2276}
2277LSSL_ALIAS(SSL_CTX_set_default_passwd_cb);
2168 2278
2169void * 2279void *
2170SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx) 2280SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx)
2171{ 2281{
2172 return ctx->default_passwd_callback_userdata; 2282 return ctx->default_passwd_callback_userdata;
2173} 2283}
2284LSSL_ALIAS(SSL_CTX_get_default_passwd_cb_userdata);
2174 2285
2175void 2286void
2176SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u) 2287SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u)
2177{ 2288{
2178 ctx->default_passwd_callback_userdata = u; 2289 ctx->default_passwd_callback_userdata = u;
2179} 2290}
2291LSSL_ALIAS(SSL_CTX_set_default_passwd_cb_userdata);
2180 2292
2181void 2293void
2182SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, 2294SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,
@@ -2185,6 +2297,7 @@ SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,
2185 ctx->app_verify_callback = cb; 2297 ctx->app_verify_callback = cb;
2186 ctx->app_verify_arg = arg; 2298 ctx->app_verify_arg = arg;
2187} 2299}
2300LSSL_ALIAS(SSL_CTX_set_cert_verify_callback);
2188 2301
2189void 2302void
2190SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*cb)(int, X509_STORE_CTX *)) 2303SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*cb)(int, X509_STORE_CTX *))
@@ -2192,12 +2305,14 @@ SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*cb)(int, X509_STORE_CTX *))
2192 ctx->verify_mode = mode; 2305 ctx->verify_mode = mode;
2193 ctx->default_verify_callback = cb; 2306 ctx->default_verify_callback = cb;
2194} 2307}
2308LSSL_ALIAS(SSL_CTX_set_verify);
2195 2309
2196void 2310void
2197SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth) 2311SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth)
2198{ 2312{
2199 X509_VERIFY_PARAM_set_depth(ctx->param, depth); 2313 X509_VERIFY_PARAM_set_depth(ctx->param, depth);
2200} 2314}
2315LSSL_ALIAS(SSL_CTX_set_verify_depth);
2201 2316
2202void 2317void
2203ssl_set_cert_masks(SSL_CERT *c, const SSL_CIPHER *cipher) 2318ssl_set_cert_masks(SSL_CERT *c, const SSL_CIPHER *cipher)
@@ -2478,6 +2593,7 @@ SSL_get_ssl_method(SSL *s)
2478{ 2593{
2479 return (s->method); 2594 return (s->method);
2480} 2595}
2596LSSL_ALIAS(SSL_get_ssl_method);
2481 2597
2482int 2598int
2483SSL_set_ssl_method(SSL *s, const SSL_METHOD *method) 2599SSL_set_ssl_method(SSL *s, const SSL_METHOD *method)
@@ -2504,6 +2620,7 @@ SSL_set_ssl_method(SSL *s, const SSL_METHOD *method)
2504 2620
2505 return (ret); 2621 return (ret);
2506} 2622}
2623LSSL_ALIAS(SSL_set_ssl_method);
2507 2624
2508int 2625int
2509SSL_get_error(const SSL *s, int i) 2626SSL_get_error(const SSL *s, int i)
@@ -2583,6 +2700,7 @@ SSL_get_error(const SSL *s, int i)
2583 2700
2584 return (SSL_ERROR_SYSCALL); 2701 return (SSL_ERROR_SYSCALL);
2585} 2702}
2703LSSL_ALIAS(SSL_get_error);
2586 2704
2587int 2705int
2588SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method) 2706SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method)
@@ -2594,6 +2712,7 @@ SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method)
2594 2712
2595 return 1; 2713 return 1;
2596} 2714}
2715LSSL_ALIAS(SSL_CTX_set_quic_method);
2597 2716
2598int 2717int
2599SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method) 2718SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method)
@@ -2605,6 +2724,7 @@ SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method)
2605 2724
2606 return 1; 2725 return 1;
2607} 2726}
2727LSSL_ALIAS(SSL_set_quic_method);
2608 2728
2609size_t 2729size_t
2610SSL_quic_max_handshake_flight_len(const SSL *ssl, 2730SSL_quic_max_handshake_flight_len(const SSL *ssl,
@@ -2652,18 +2772,21 @@ SSL_quic_max_handshake_flight_len(const SSL *ssl,
2652 2772
2653 return 0; 2773 return 0;
2654} 2774}
2775LSSL_ALIAS(SSL_quic_max_handshake_flight_len);
2655 2776
2656enum ssl_encryption_level_t 2777enum ssl_encryption_level_t
2657SSL_quic_read_level(const SSL *ssl) 2778SSL_quic_read_level(const SSL *ssl)
2658{ 2779{
2659 return ssl->s3->hs.tls13.quic_read_level; 2780 return ssl->s3->hs.tls13.quic_read_level;
2660} 2781}
2782LSSL_ALIAS(SSL_quic_read_level);
2661 2783
2662enum ssl_encryption_level_t 2784enum ssl_encryption_level_t
2663SSL_quic_write_level(const SSL *ssl) 2785SSL_quic_write_level(const SSL *ssl)
2664{ 2786{
2665 return ssl->s3->hs.tls13.quic_write_level; 2787 return ssl->s3->hs.tls13.quic_write_level;
2666} 2788}
2789LSSL_ALIAS(SSL_quic_write_level);
2667 2790
2668int 2791int
2669SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level, 2792SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level,
@@ -2697,6 +2820,7 @@ SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level,
2697 */ 2820 */
2698 return tls_buffer_append(ssl->s3->hs.tls13.quic_read_buffer, data, len); 2821 return tls_buffer_append(ssl->s3->hs.tls13.quic_read_buffer, data, len);
2699} 2822}
2823LSSL_ALIAS(SSL_provide_quic_data);
2700 2824
2701int 2825int
2702SSL_process_quic_post_handshake(SSL *ssl) 2826SSL_process_quic_post_handshake(SSL *ssl)
@@ -2704,6 +2828,7 @@ SSL_process_quic_post_handshake(SSL *ssl)
2704 /* XXX - this needs to run PHH received. */ 2828 /* XXX - this needs to run PHH received. */
2705 return 1; 2829 return 1;
2706} 2830}
2831LSSL_ALIAS(SSL_process_quic_post_handshake);
2707 2832
2708int 2833int
2709SSL_do_handshake(SSL *s) 2834SSL_do_handshake(SSL *s)
@@ -2720,6 +2845,7 @@ SSL_do_handshake(SSL *s)
2720 2845
2721 return s->handshake_func(s); 2846 return s->handshake_func(s);
2722} 2847}
2848LSSL_ALIAS(SSL_do_handshake);
2723 2849
2724/* 2850/*
2725 * For the next 2 functions, SSL_clear() sets shutdown and so 2851 * For the next 2 functions, SSL_clear() sets shutdown and so
@@ -2734,6 +2860,7 @@ SSL_set_accept_state(SSL *s)
2734 s->handshake_func = s->method->ssl_accept; 2860 s->handshake_func = s->method->ssl_accept;
2735 ssl_clear_cipher_state(s); 2861 ssl_clear_cipher_state(s);
2736} 2862}
2863LSSL_ALIAS(SSL_set_accept_state);
2737 2864
2738void 2865void
2739SSL_set_connect_state(SSL *s) 2866SSL_set_connect_state(SSL *s)
@@ -2744,6 +2871,7 @@ SSL_set_connect_state(SSL *s)
2744 s->handshake_func = s->method->ssl_connect; 2871 s->handshake_func = s->method->ssl_connect;
2745 ssl_clear_cipher_state(s); 2872 ssl_clear_cipher_state(s);
2746} 2873}
2874LSSL_ALIAS(SSL_set_connect_state);
2747 2875
2748int 2876int
2749ssl_undefined_function(SSL *s) 2877ssl_undefined_function(SSL *s)
@@ -2792,6 +2920,7 @@ SSL_get_version(const SSL *s)
2792{ 2920{
2793 return ssl_version_string(s->version); 2921 return ssl_version_string(s->version);
2794} 2922}
2923LSSL_ALIAS(SSL_get_version);
2795 2924
2796SSL * 2925SSL *
2797SSL_dup(SSL *s) 2926SSL_dup(SSL *s)
@@ -2915,6 +3044,7 @@ SSL_dup(SSL *s)
2915 SSL_free(ret); 3044 SSL_free(ret);
2916 return NULL; 3045 return NULL;
2917} 3046}
3047LSSL_ALIAS(SSL_dup);
2918 3048
2919void 3049void
2920ssl_clear_cipher_state(SSL *s) 3050ssl_clear_cipher_state(SSL *s)
@@ -2957,6 +3087,7 @@ SSL_get_certificate(const SSL *s)
2957{ 3087{
2958 return (s->cert->key->x509); 3088 return (s->cert->key->x509);
2959} 3089}
3090LSSL_ALIAS(SSL_get_certificate);
2960 3091
2961/* Fix this function so that it takes an optional type parameter */ 3092/* Fix this function so that it takes an optional type parameter */
2962EVP_PKEY * 3093EVP_PKEY *
@@ -2964,6 +3095,7 @@ SSL_get_privatekey(const SSL *s)
2964{ 3095{
2965 return (s->cert->key->privatekey); 3096 return (s->cert->key->privatekey);
2966} 3097}
3098LSSL_ALIAS(SSL_get_privatekey);
2967 3099
2968const SSL_CIPHER * 3100const SSL_CIPHER *
2969SSL_get_current_cipher(const SSL *s) 3101SSL_get_current_cipher(const SSL *s)
@@ -2972,17 +3104,20 @@ SSL_get_current_cipher(const SSL *s)
2972 return (s->session->cipher); 3104 return (s->session->cipher);
2973 return (NULL); 3105 return (NULL);
2974} 3106}
3107LSSL_ALIAS(SSL_get_current_cipher);
2975const void * 3108const void *
2976SSL_get_current_compression(SSL *s) 3109SSL_get_current_compression(SSL *s)
2977{ 3110{
2978 return (NULL); 3111 return (NULL);
2979} 3112}
3113LSSL_ALIAS(SSL_get_current_compression);
2980 3114
2981const void * 3115const void *
2982SSL_get_current_expansion(SSL *s) 3116SSL_get_current_expansion(SSL *s)
2983{ 3117{
2984 return (NULL); 3118 return (NULL);
2985} 3119}
3120LSSL_ALIAS(SSL_get_current_expansion);
2986 3121
2987size_t 3122size_t
2988SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out) 3123SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out)
@@ -2999,6 +3134,7 @@ SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out)
2999 3134
3000 return len; 3135 return len;
3001} 3136}
3137LSSL_ALIAS(SSL_get_client_random);
3002 3138
3003size_t 3139size_t
3004SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out) 3140SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out)
@@ -3015,6 +3151,7 @@ SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out)
3015 3151
3016 return len; 3152 return len;
3017} 3153}
3154LSSL_ALIAS(SSL_get_server_random);
3018 3155
3019int 3156int
3020ssl_init_wbio_buffer(SSL *s, int push) 3157ssl_init_wbio_buffer(SSL *s, int push)
@@ -3069,48 +3206,56 @@ SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode)
3069{ 3206{
3070 ctx->quiet_shutdown = mode; 3207 ctx->quiet_shutdown = mode;
3071} 3208}
3209LSSL_ALIAS(SSL_CTX_set_quiet_shutdown);
3072 3210
3073int 3211int
3074SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx) 3212SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx)
3075{ 3213{
3076 return (ctx->quiet_shutdown); 3214 return (ctx->quiet_shutdown);
3077} 3215}
3216LSSL_ALIAS(SSL_CTX_get_quiet_shutdown);
3078 3217
3079void 3218void
3080SSL_set_quiet_shutdown(SSL *s, int mode) 3219SSL_set_quiet_shutdown(SSL *s, int mode)
3081{ 3220{
3082 s->quiet_shutdown = mode; 3221 s->quiet_shutdown = mode;
3083} 3222}
3223LSSL_ALIAS(SSL_set_quiet_shutdown);
3084 3224
3085int 3225int
3086SSL_get_quiet_shutdown(const SSL *s) 3226SSL_get_quiet_shutdown(const SSL *s)
3087{ 3227{
3088 return (s->quiet_shutdown); 3228 return (s->quiet_shutdown);
3089} 3229}
3230LSSL_ALIAS(SSL_get_quiet_shutdown);
3090 3231
3091void 3232void
3092SSL_set_shutdown(SSL *s, int mode) 3233SSL_set_shutdown(SSL *s, int mode)
3093{ 3234{
3094 s->shutdown = mode; 3235 s->shutdown = mode;
3095} 3236}
3237LSSL_ALIAS(SSL_set_shutdown);
3096 3238
3097int 3239int
3098SSL_get_shutdown(const SSL *s) 3240SSL_get_shutdown(const SSL *s)
3099{ 3241{
3100 return (s->shutdown); 3242 return (s->shutdown);
3101} 3243}
3244LSSL_ALIAS(SSL_get_shutdown);
3102 3245
3103int 3246int
3104SSL_version(const SSL *s) 3247SSL_version(const SSL *s)
3105{ 3248{
3106 return (s->version); 3249 return (s->version);
3107} 3250}
3251LSSL_ALIAS(SSL_version);
3108 3252
3109SSL_CTX * 3253SSL_CTX *
3110SSL_get_SSL_CTX(const SSL *ssl) 3254SSL_get_SSL_CTX(const SSL *ssl)
3111{ 3255{
3112 return (ssl->ctx); 3256 return (ssl->ctx);
3113} 3257}
3258LSSL_ALIAS(SSL_get_SSL_CTX);
3114 3259
3115SSL_CTX * 3260SSL_CTX *
3116SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx) 3261SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx)
@@ -3133,12 +3278,14 @@ SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx)
3133 3278
3134 return (ssl->ctx); 3279 return (ssl->ctx);
3135} 3280}
3281LSSL_ALIAS(SSL_set_SSL_CTX);
3136 3282
3137int 3283int
3138SSL_CTX_set_default_verify_paths(SSL_CTX *ctx) 3284SSL_CTX_set_default_verify_paths(SSL_CTX *ctx)
3139{ 3285{
3140 return (X509_STORE_set_default_paths(ctx->cert_store)); 3286 return (X509_STORE_set_default_paths(ctx->cert_store));
3141} 3287}
3288LSSL_ALIAS(SSL_CTX_set_default_verify_paths);
3142 3289
3143int 3290int
3144SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, 3291SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
@@ -3146,18 +3293,21 @@ SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
3146{ 3293{
3147 return (X509_STORE_load_locations(ctx->cert_store, CAfile, CApath)); 3294 return (X509_STORE_load_locations(ctx->cert_store, CAfile, CApath));
3148} 3295}
3296LSSL_ALIAS(SSL_CTX_load_verify_locations);
3149 3297
3150int 3298int
3151SSL_CTX_load_verify_mem(SSL_CTX *ctx, void *buf, int len) 3299SSL_CTX_load_verify_mem(SSL_CTX *ctx, void *buf, int len)
3152{ 3300{
3153 return (X509_STORE_load_mem(ctx->cert_store, buf, len)); 3301 return (X509_STORE_load_mem(ctx->cert_store, buf, len));
3154} 3302}
3303LSSL_ALIAS(SSL_CTX_load_verify_mem);
3155 3304
3156void 3305void
3157SSL_set_info_callback(SSL *ssl, void (*cb)(const SSL *ssl, int type, int val)) 3306SSL_set_info_callback(SSL *ssl, void (*cb)(const SSL *ssl, int type, int val))
3158{ 3307{
3159 ssl->info_callback = cb; 3308 ssl->info_callback = cb;
3160} 3309}
3310LSSL_ALIAS(SSL_set_info_callback);
3161 3311
3162void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, int val) 3312void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, int val)
3163{ 3313{
@@ -3169,42 +3319,49 @@ SSL_state(const SSL *ssl)
3169{ 3319{
3170 return (ssl->s3->hs.state); 3320 return (ssl->s3->hs.state);
3171} 3321}
3322LSSL_ALIAS(SSL_state);
3172 3323
3173void 3324void
3174SSL_set_state(SSL *ssl, int state) 3325SSL_set_state(SSL *ssl, int state)
3175{ 3326{
3176 ssl->s3->hs.state = state; 3327 ssl->s3->hs.state = state;
3177} 3328}
3329LSSL_ALIAS(SSL_set_state);
3178 3330
3179void 3331void
3180SSL_set_verify_result(SSL *ssl, long arg) 3332SSL_set_verify_result(SSL *ssl, long arg)
3181{ 3333{
3182 ssl->verify_result = arg; 3334 ssl->verify_result = arg;
3183} 3335}
3336LSSL_ALIAS(SSL_set_verify_result);
3184 3337
3185long 3338long
3186SSL_get_verify_result(const SSL *ssl) 3339SSL_get_verify_result(const SSL *ssl)
3187{ 3340{
3188 return (ssl->verify_result); 3341 return (ssl->verify_result);
3189} 3342}
3343LSSL_ALIAS(SSL_get_verify_result);
3190 3344
3191int 3345int
3192SSL_verify_client_post_handshake(SSL *ssl) 3346SSL_verify_client_post_handshake(SSL *ssl)
3193{ 3347{
3194 return 0; 3348 return 0;
3195} 3349}
3350LSSL_ALIAS(SSL_verify_client_post_handshake);
3196 3351
3197void 3352void
3198SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val) 3353SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val)
3199{ 3354{
3200 return; 3355 return;
3201} 3356}
3357LSSL_ALIAS(SSL_CTX_set_post_handshake_auth);
3202 3358
3203void 3359void
3204SSL_set_post_handshake_auth(SSL *ssl, int val) 3360SSL_set_post_handshake_auth(SSL *ssl, int val)
3205{ 3361{
3206 return; 3362 return;
3207} 3363}
3364LSSL_ALIAS(SSL_set_post_handshake_auth);
3208 3365
3209int 3366int
3210SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 3367SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@@ -3213,18 +3370,21 @@ SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
3213 return (CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, argl, argp, 3370 return (CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, argl, argp,
3214 new_func, dup_func, free_func)); 3371 new_func, dup_func, free_func));
3215} 3372}
3373LSSL_ALIAS(SSL_get_ex_new_index);
3216 3374
3217int 3375int
3218SSL_set_ex_data(SSL *s, int idx, void *arg) 3376SSL_set_ex_data(SSL *s, int idx, void *arg)
3219{ 3377{
3220 return (CRYPTO_set_ex_data(&s->ex_data, idx, arg)); 3378 return (CRYPTO_set_ex_data(&s->ex_data, idx, arg));
3221} 3379}
3380LSSL_ALIAS(SSL_set_ex_data);
3222 3381
3223void * 3382void *
3224SSL_get_ex_data(const SSL *s, int idx) 3383SSL_get_ex_data(const SSL *s, int idx)
3225{ 3384{
3226 return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3385 return (CRYPTO_get_ex_data(&s->ex_data, idx));
3227} 3386}
3387LSSL_ALIAS(SSL_get_ex_data);
3228 3388
3229int 3389int
3230SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 3390SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@@ -3233,18 +3393,21 @@ SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
3233 return (CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, argl, argp, 3393 return (CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, argl, argp,
3234 new_func, dup_func, free_func)); 3394 new_func, dup_func, free_func));
3235} 3395}
3396LSSL_ALIAS(SSL_CTX_get_ex_new_index);
3236 3397
3237int 3398int
3238SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) 3399SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)
3239{ 3400{
3240 return (CRYPTO_set_ex_data(&s->ex_data, idx, arg)); 3401 return (CRYPTO_set_ex_data(&s->ex_data, idx, arg));
3241} 3402}
3403LSSL_ALIAS(SSL_CTX_set_ex_data);
3242 3404
3243void * 3405void *
3244SSL_CTX_get_ex_data(const SSL_CTX *s, int idx) 3406SSL_CTX_get_ex_data(const SSL_CTX *s, int idx)
3245{ 3407{
3246 return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3408 return (CRYPTO_get_ex_data(&s->ex_data, idx));
3247} 3409}
3410LSSL_ALIAS(SSL_CTX_get_ex_data);
3248 3411
3249int 3412int
3250ssl_ok(SSL *s) 3413ssl_ok(SSL *s)
@@ -3257,6 +3420,7 @@ SSL_CTX_get_cert_store(const SSL_CTX *ctx)
3257{ 3420{
3258 return (ctx->cert_store); 3421 return (ctx->cert_store);
3259} 3422}
3423LSSL_ALIAS(SSL_CTX_get_cert_store);
3260 3424
3261void 3425void
3262SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store) 3426SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store)
@@ -3264,6 +3428,7 @@ SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store)
3264 X509_STORE_free(ctx->cert_store); 3428 X509_STORE_free(ctx->cert_store);
3265 ctx->cert_store = store; 3429 ctx->cert_store = store;
3266} 3430}
3431LSSL_ALIAS(SSL_CTX_set_cert_store);
3267 3432
3268X509 * 3433X509 *
3269SSL_CTX_get0_certificate(const SSL_CTX *ctx) 3434SSL_CTX_get0_certificate(const SSL_CTX *ctx)
@@ -3273,6 +3438,7 @@ SSL_CTX_get0_certificate(const SSL_CTX *ctx)
3273 3438
3274 return ctx->cert->key->x509; 3439 return ctx->cert->key->x509;
3275} 3440}
3441LSSL_ALIAS(SSL_CTX_get0_certificate);
3276 3442
3277EVP_PKEY * 3443EVP_PKEY *
3278SSL_CTX_get0_privatekey(const SSL_CTX *ctx) 3444SSL_CTX_get0_privatekey(const SSL_CTX *ctx)
@@ -3282,12 +3448,14 @@ SSL_CTX_get0_privatekey(const SSL_CTX *ctx)
3282 3448
3283 return ctx->cert->key->privatekey; 3449 return ctx->cert->key->privatekey;
3284} 3450}
3451LSSL_ALIAS(SSL_CTX_get0_privatekey);
3285 3452
3286int 3453int
3287SSL_want(const SSL *s) 3454SSL_want(const SSL *s)
3288{ 3455{
3289 return (s->rwstate); 3456 return (s->rwstate);
3290} 3457}
3458LSSL_ALIAS(SSL_want);
3291 3459
3292void 3460void
3293SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export, 3461SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export,
@@ -3295,6 +3463,7 @@ SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export,
3295{ 3463{
3296 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_RSA_CB,(void (*)(void))cb); 3464 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_RSA_CB,(void (*)(void))cb);
3297} 3465}
3466LSSL_ALIAS(SSL_CTX_set_tmp_rsa_callback);
3298 3467
3299void 3468void
3300SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, 3469SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export,
@@ -3302,6 +3471,7 @@ SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export,
3302{ 3471{
3303 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_RSA_CB,(void (*)(void))cb); 3472 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_RSA_CB,(void (*)(void))cb);
3304} 3473}
3474LSSL_ALIAS(SSL_set_tmp_rsa_callback);
3305 3475
3306void 3476void
3307SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, DH *(*dh)(SSL *ssl, int is_export, 3477SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, DH *(*dh)(SSL *ssl, int is_export,
@@ -3309,6 +3479,7 @@ SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, DH *(*dh)(SSL *ssl, int is_export,
3309{ 3479{
3310 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_DH_CB,(void (*)(void))dh); 3480 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_DH_CB,(void (*)(void))dh);
3311} 3481}
3482LSSL_ALIAS(SSL_CTX_set_tmp_dh_callback);
3312 3483
3313void 3484void
3314SSL_set_tmp_dh_callback(SSL *ssl, DH *(*dh)(SSL *ssl, int is_export, 3485SSL_set_tmp_dh_callback(SSL *ssl, DH *(*dh)(SSL *ssl, int is_export,
@@ -3316,6 +3487,7 @@ SSL_set_tmp_dh_callback(SSL *ssl, DH *(*dh)(SSL *ssl, int is_export,
3316{ 3487{
3317 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_DH_CB,(void (*)(void))dh); 3488 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_DH_CB,(void (*)(void))dh);
3318} 3489}
3490LSSL_ALIAS(SSL_set_tmp_dh_callback);
3319 3491
3320void 3492void
3321SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, EC_KEY *(*ecdh)(SSL *ssl, 3493SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, EC_KEY *(*ecdh)(SSL *ssl,
@@ -3324,6 +3496,7 @@ SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, EC_KEY *(*ecdh)(SSL *ssl,
3324 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH_CB, 3496 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH_CB,
3325 (void (*)(void))ecdh); 3497 (void (*)(void))ecdh);
3326} 3498}
3499LSSL_ALIAS(SSL_CTX_set_tmp_ecdh_callback);
3327 3500
3328void 3501void
3329SSL_set_tmp_ecdh_callback(SSL *ssl, EC_KEY *(*ecdh)(SSL *ssl, int is_export, 3502SSL_set_tmp_ecdh_callback(SSL *ssl, EC_KEY *(*ecdh)(SSL *ssl, int is_export,
@@ -3331,6 +3504,7 @@ SSL_set_tmp_ecdh_callback(SSL *ssl, EC_KEY *(*ecdh)(SSL *ssl, int is_export,
3331{ 3504{
3332 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH_CB,(void (*)(void))ecdh); 3505 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH_CB,(void (*)(void))ecdh);
3333} 3506}
3507LSSL_ALIAS(SSL_set_tmp_ecdh_callback);
3334 3508
3335 3509
3336void 3510void
@@ -3340,6 +3514,7 @@ SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version,
3340 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_MSG_CALLBACK, 3514 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_MSG_CALLBACK,
3341 (void (*)(void))cb); 3515 (void (*)(void))cb);
3342} 3516}
3517LSSL_ALIAS(SSL_CTX_set_msg_callback);
3343 3518
3344void 3519void
3345SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, 3520SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version,
@@ -3347,24 +3522,28 @@ SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version,
3347{ 3522{
3348 SSL_callback_ctrl(ssl, SSL_CTRL_SET_MSG_CALLBACK, (void (*)(void))cb); 3523 SSL_callback_ctrl(ssl, SSL_CTRL_SET_MSG_CALLBACK, (void (*)(void))cb);
3349} 3524}
3525LSSL_ALIAS(SSL_set_msg_callback);
3350 3526
3351void 3527void
3352SSL_set_debug(SSL *s, int debug) 3528SSL_set_debug(SSL *s, int debug)
3353{ 3529{
3354 s->debug = debug; 3530 s->debug = debug;
3355} 3531}
3532LSSL_ALIAS(SSL_set_debug);
3356 3533
3357int 3534int
3358SSL_cache_hit(SSL *s) 3535SSL_cache_hit(SSL *s)
3359{ 3536{
3360 return (s->hit); 3537 return (s->hit);
3361} 3538}
3539LSSL_ALIAS(SSL_cache_hit);
3362 3540
3363int 3541int
3364SSL_CTX_get_min_proto_version(SSL_CTX *ctx) 3542SSL_CTX_get_min_proto_version(SSL_CTX *ctx)
3365{ 3543{
3366 return ctx->min_proto_version; 3544 return ctx->min_proto_version;
3367} 3545}
3546LSSL_ALIAS(SSL_CTX_get_min_proto_version);
3368 3547
3369int 3548int
3370SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) 3549SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version)
@@ -3373,12 +3552,14 @@ SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version)
3373 ctx->max_tls_version, &ctx->min_tls_version, 3552 ctx->max_tls_version, &ctx->min_tls_version,
3374 &ctx->min_proto_version); 3553 &ctx->min_proto_version);
3375} 3554}
3555LSSL_ALIAS(SSL_CTX_set_min_proto_version);
3376 3556
3377int 3557int
3378SSL_CTX_get_max_proto_version(SSL_CTX *ctx) 3558SSL_CTX_get_max_proto_version(SSL_CTX *ctx)
3379{ 3559{
3380 return ctx->max_proto_version; 3560 return ctx->max_proto_version;
3381} 3561}
3562LSSL_ALIAS(SSL_CTX_get_max_proto_version);
3382 3563
3383int 3564int
3384SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) 3565SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version)
@@ -3387,12 +3568,14 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version)
3387 ctx->min_tls_version, &ctx->max_tls_version, 3568 ctx->min_tls_version, &ctx->max_tls_version,
3388 &ctx->max_proto_version); 3569 &ctx->max_proto_version);
3389} 3570}
3571LSSL_ALIAS(SSL_CTX_set_max_proto_version);
3390 3572
3391int 3573int
3392SSL_get_min_proto_version(SSL *ssl) 3574SSL_get_min_proto_version(SSL *ssl)
3393{ 3575{
3394 return ssl->min_proto_version; 3576 return ssl->min_proto_version;
3395} 3577}
3578LSSL_ALIAS(SSL_get_min_proto_version);
3396 3579
3397int 3580int
3398SSL_set_min_proto_version(SSL *ssl, uint16_t version) 3581SSL_set_min_proto_version(SSL *ssl, uint16_t version)
@@ -3401,11 +3584,13 @@ SSL_set_min_proto_version(SSL *ssl, uint16_t version)
3401 ssl->max_tls_version, &ssl->min_tls_version, 3584 ssl->max_tls_version, &ssl->min_tls_version,
3402 &ssl->min_proto_version); 3585 &ssl->min_proto_version);
3403} 3586}
3587LSSL_ALIAS(SSL_set_min_proto_version);
3404int 3588int
3405SSL_get_max_proto_version(SSL *ssl) 3589SSL_get_max_proto_version(SSL *ssl)
3406{ 3590{
3407 return ssl->max_proto_version; 3591 return ssl->max_proto_version;
3408} 3592}
3593LSSL_ALIAS(SSL_get_max_proto_version);
3409 3594
3410int 3595int
3411SSL_set_max_proto_version(SSL *ssl, uint16_t version) 3596SSL_set_max_proto_version(SSL *ssl, uint16_t version)
@@ -3414,42 +3599,49 @@ SSL_set_max_proto_version(SSL *ssl, uint16_t version)
3414 ssl->min_tls_version, &ssl->max_tls_version, 3599 ssl->min_tls_version, &ssl->max_tls_version,
3415 &ssl->max_proto_version); 3600 &ssl->max_proto_version);
3416} 3601}
3602LSSL_ALIAS(SSL_set_max_proto_version);
3417 3603
3418const SSL_METHOD * 3604const SSL_METHOD *
3419SSL_CTX_get_ssl_method(const SSL_CTX *ctx) 3605SSL_CTX_get_ssl_method(const SSL_CTX *ctx)
3420{ 3606{
3421 return ctx->method; 3607 return ctx->method;
3422} 3608}
3609LSSL_ALIAS(SSL_CTX_get_ssl_method);
3423 3610
3424int 3611int
3425SSL_CTX_get_security_level(const SSL_CTX *ctx) 3612SSL_CTX_get_security_level(const SSL_CTX *ctx)
3426{ 3613{
3427 return ctx->cert->security_level; 3614 return ctx->cert->security_level;
3428} 3615}
3616LSSL_ALIAS(SSL_CTX_get_security_level);
3429 3617
3430void 3618void
3431SSL_CTX_set_security_level(SSL_CTX *ctx, int level) 3619SSL_CTX_set_security_level(SSL_CTX *ctx, int level)
3432{ 3620{
3433 ctx->cert->security_level = level; 3621 ctx->cert->security_level = level;
3434} 3622}
3623LSSL_ALIAS(SSL_CTX_set_security_level);
3435 3624
3436int 3625int
3437SSL_get_security_level(const SSL *ssl) 3626SSL_get_security_level(const SSL *ssl)
3438{ 3627{
3439 return ssl->cert->security_level; 3628 return ssl->cert->security_level;
3440} 3629}
3630LSSL_ALIAS(SSL_get_security_level);
3441 3631
3442void 3632void
3443SSL_set_security_level(SSL *ssl, int level) 3633SSL_set_security_level(SSL *ssl, int level)
3444{ 3634{
3445 ssl->cert->security_level = level; 3635 ssl->cert->security_level = level;
3446} 3636}
3637LSSL_ALIAS(SSL_set_security_level);
3447 3638
3448int 3639int
3449SSL_is_quic(const SSL *ssl) 3640SSL_is_quic(const SSL *ssl)
3450{ 3641{
3451 return ssl->quic_method != NULL; 3642 return ssl->quic_method != NULL;
3452} 3643}
3644LSSL_ALIAS(SSL_is_quic);
3453 3645
3454int 3646int
3455SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params, 3647SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params,
@@ -3468,6 +3660,7 @@ SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params,
3468 3660
3469 return 1; 3661 return 1;
3470} 3662}
3663LSSL_ALIAS(SSL_set_quic_transport_params);
3471 3664
3472void 3665void
3473SSL_get_peer_quic_transport_params(const SSL *ssl, const uint8_t **out_params, 3666SSL_get_peer_quic_transport_params(const SSL *ssl, const uint8_t **out_params,
@@ -3476,12 +3669,14 @@ SSL_get_peer_quic_transport_params(const SSL *ssl, const uint8_t **out_params,
3476 *out_params = ssl->s3->peer_quic_transport_params; 3669 *out_params = ssl->s3->peer_quic_transport_params;
3477 *out_params_len = ssl->s3->peer_quic_transport_params_len; 3670 *out_params_len = ssl->s3->peer_quic_transport_params_len;
3478} 3671}
3672LSSL_ALIAS(SSL_get_peer_quic_transport_params);
3479 3673
3480void 3674void
3481SSL_set_quic_use_legacy_codepoint(SSL *ssl, int use_legacy) 3675SSL_set_quic_use_legacy_codepoint(SSL *ssl, int use_legacy)
3482{ 3676{
3483 /* Not supported. */ 3677 /* Not supported. */
3484} 3678}
3679LSSL_ALIAS(SSL_set_quic_use_legacy_codepoint);
3485 3680
3486static int 3681static int
3487ssl_cipher_id_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) 3682ssl_cipher_id_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)