|
| 1 | +/* ada_binding.c |
| 2 | + * |
| 3 | + * Copyright (C) 2006-2023 wolfSSL Inc. |
| 4 | + * |
| 5 | + * This file is part of wolfSSL. |
| 6 | + * |
| 7 | + * wolfSSL is free software; you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation; either version 2 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * wolfSSL is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program; if not, write to the Free Software |
| 19 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
| 20 | + */ |
| 21 | + |
| 22 | +/* wolfSSL */ |
| 23 | +#include <wolfssl/wolfcrypt/settings.h> |
| 24 | + |
| 25 | +#include <wolfssl/ssl.h> |
| 26 | + |
| 27 | +// These functions give access to the integer values of the enumeration |
| 28 | +// constants used in WolfSSL. These functions make it possible |
| 29 | +// for the WolfSSL implementation to change the values of the constants |
| 30 | +// without the need to make a corresponding change in the Ada code. |
| 31 | +extern int get_wolfssl_success(void); |
| 32 | +extern int get_wolfssl_verify_none(void); |
| 33 | +extern int get_wolfssl_verify_peer(void); |
| 34 | +extern int get_wolfssl_verify_fail_if_no_peer_cert(void); |
| 35 | +extern int get_wolfssl_verify_client_once(void); |
| 36 | +extern int get_wolfssl_verify_post_handshake(void); |
| 37 | +extern int get_wolfssl_verify_fail_except_psk(void); |
| 38 | +extern int get_wolfssl_verify_default(void); |
| 39 | + |
| 40 | +extern int get_wolfssl_filetype_asn1(void); |
| 41 | +extern int get_wolfssl_filetype_pem(void); |
| 42 | +extern int get_wolfssl_filetype_default(void); |
| 43 | + |
| 44 | +extern int get_wolfssl_success(void) { |
| 45 | + return WOLFSSL_SUCCESS; |
| 46 | +} |
| 47 | + |
| 48 | +extern int get_wolfssl_verify_none(void) { |
| 49 | + return WOLFSSL_VERIFY_NONE; |
| 50 | +} |
| 51 | + |
| 52 | +extern int get_wolfssl_verify_peer(void) { |
| 53 | + return WOLFSSL_VERIFY_PEER; |
| 54 | +} |
| 55 | + |
| 56 | +extern int get_wolfssl_verify_fail_if_no_peer_cert(void) { |
| 57 | + return WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT; |
| 58 | +} |
| 59 | + |
| 60 | +extern int get_wolfssl_verify_client_once(void) { |
| 61 | + return WOLFSSL_VERIFY_CLIENT_ONCE; |
| 62 | +} |
| 63 | + |
| 64 | +extern int get_wolfssl_verify_post_handshake(void) { |
| 65 | + return WOLFSSL_VERIFY_POST_HANDSHAKE; |
| 66 | +} |
| 67 | + |
| 68 | +extern int get_wolfssl_verify_fail_except_psk(void) { |
| 69 | + return WOLFSSL_VERIFY_FAIL_EXCEPT_PSK; |
| 70 | +} |
| 71 | + |
| 72 | +extern int get_wolfssl_verify_default(void) { |
| 73 | + return WOLFSSL_VERIFY_DEFAULT; |
| 74 | +} |
| 75 | + |
| 76 | +extern int get_wolfssl_filetype_asn1(void) { |
| 77 | + return WOLFSSL_FILETYPE_ASN1; |
| 78 | +} |
| 79 | + |
| 80 | +extern int get_wolfssl_filetype_pem(void) { |
| 81 | + return WOLFSSL_FILETYPE_PEM; |
| 82 | +} |
| 83 | + |
| 84 | +extern int get_wolfssl_filetype_default(void) { |
| 85 | + return WOLFSSL_FILETYPE_DEFAULT; |
| 86 | +} |
0 commit comments