/// # Safety
///
/// input must be a valid buffer of at least input_len bytes
-/// pointer must be freed using `rs_asn1_free`
+/// pointer must be freed using `SCAsn1Free`
#[no_mangle]
-pub unsafe extern "C" fn rs_asn1_decode(
+pub unsafe extern "C" fn SCAsn1Decode(
input: *const u8, input_len: u32, buffer_offset: u32, ad_ptr: *const DetectAsn1Data,
) -> *mut Asn1<'static> {
if input.is_null() || input_len == 0 || ad_ptr.is_null() {
///
/// # Safety
///
-/// ptr must be a valid object obtained using `rs_asn1_decode`
+/// ptr must be a valid object obtained using `SCAsn1Decode`
#[no_mangle]
-pub unsafe extern "C" fn rs_asn1_free(ptr: *mut Asn1) {
+pub unsafe extern "C" fn SCAsn1Free(ptr: *mut Asn1) {
if ptr.is_null() {
return;
}
///
/// # Safety
///
-/// ptr must be a valid object obtained using `rs_asn1_decode`
-/// ad_ptr must be a valid object obtained using `rs_detect_asn1_parse`
+/// ptr must be a valid object obtained using `SCAsn1Decode`
+/// ad_ptr must be a valid object obtained using `SCAsn1DetectParse`
///
/// Returns 1 if any of the options match, 0 if not
#[no_mangle]
-pub unsafe extern "C" fn rs_asn1_checks(ptr: *const Asn1, ad_ptr: *const DetectAsn1Data) -> u8 {
+pub unsafe extern "C" fn SCAsn1Checks(ptr: *const Asn1, ad_ptr: *const DetectAsn1Data) -> u8 {
if ptr.is_null() || ad_ptr.is_null() {
return 0;
}
///
/// # Safety
///
-/// pointer must be free'd using `rs_detect_asn1_free`
+/// pointer must be free'd using `SCAsn1DetectFree`
#[no_mangle]
-pub unsafe extern "C" fn rs_detect_asn1_parse(input: *const c_char) -> *mut DetectAsn1Data {
+pub unsafe extern "C" fn SCAsn1DetectParse(input: *const c_char) -> *mut DetectAsn1Data {
if input.is_null() {
return std::ptr::null_mut();
}
///
/// # Safety
///
-/// ptr must be a valid object obtained using `rs_detect_asn1_parse`
+/// ptr must be a valid object obtained using `SCAsn1DetectParse`
#[no_mangle]
-pub unsafe extern "C" fn rs_detect_asn1_free(ptr: *mut DetectAsn1Data) {
+pub unsafe extern "C" fn SCAsn1DetectFree(ptr: *mut DetectAsn1Data) {
if ptr.is_null() {
return;
}
const uint32_t offset)
{
const DetectAsn1Data *ad = (const DetectAsn1Data *)smd->ctx;
- Asn1 *asn1 = rs_asn1_decode(buffer, buffer_len, offset, ad);
- uint8_t ret = rs_asn1_checks(asn1, ad);
- rs_asn1_free(asn1);
+ Asn1 *asn1 = SCAsn1Decode(buffer, buffer_len, offset, ad);
+ uint8_t ret = SCAsn1Checks(asn1, ad);
+ SCAsn1Free(asn1);
return ret == 1;
}
*/
static DetectAsn1Data *DetectAsn1Parse(const char *asn1str)
{
- DetectAsn1Data *ad = rs_detect_asn1_parse(asn1str);
+ DetectAsn1Data *ad = SCAsn1DetectParse(asn1str);
if (ad == NULL) {
SCLogError("Malformed asn1 argument: %s", asn1str);
static void DetectAsn1Free(DetectEngineCtx *de_ctx, void *ptr)
{
DetectAsn1Data *ad = (DetectAsn1Data *)ptr;
- rs_detect_asn1_free(ad);
+ SCAsn1DetectFree(ad);
}
#ifdef UNITTESTS