1 // Copyright 2022 The BoringSSL Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef OPENSSL_HEADER_RUST_WRAPPER_H 16 #define OPENSSL_HEADER_RUST_WRAPPER_H 17 18 #include <openssl/err.h> 19 #include <openssl/bytestring.h> 20 21 #if defined(__cplusplus) 22 extern "C" { 23 #endif 24 25 26 // The following functions are wrappers over inline functions and macros in 27 // BoringSSL. These are not necessary, as bindgen has long supported 28 // --wrap-static-fns, however Android is still missing support for this. (See 29 // b/290347127.) These manual wrappers are, temporarily, retained for Android, 30 // but this codepath is no longer tested or supported by BoringSSL. 31 int ERR_GET_LIB_RUST(uint32_t packed_error); 32 int ERR_GET_REASON_RUST(uint32_t packed_error); 33 int ERR_GET_FUNC_RUST(uint32_t packed_error); 34 void CBS_init_RUST(CBS *cbs, const uint8_t *data, size_t len); 35 size_t CBS_len_RUST(const CBS *cbs); 36 37 #if defined(__cplusplus) 38 } // extern C 39 #endif 40 41 #endif // OPENSSL_HEADER_RUST_WRAPPER_H 42