File: libfmapi_service_provider_identifier.c

package info (click to toggle)
libesedb 20181229-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,672 kB
  • sloc: ansic: 246,874; sh: 6,096; makefile: 1,680; python: 309; sed: 16
file content (82 lines) | stat: -rw-r--r-- 2,782 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Sevice provider functions
 *
 * Copyright (C) 2009-2018, Joachim Metz <joachim.metz@gmail.com>
 *
 * Refer to AUTHORS for acknowledgements.
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <common.h>
#include <memory.h>
#include <types.h>

#include "libfmapi_class_identifier.h"

uint8_t libfmapi_service_provider_identifier_one_off_entry_identifier[ 16 ] = \
	{ 0x81, 0x2b, 0x1f, 0xa4, 0xbe, 0xa3, 0x10, 0x19, 0x9d, 0x6e, 0x00, 0xdd, 0x01, 0x0f, 0x54, 0x02 };

uint8_t libfmapi_service_provider_identifier_x500_address[ 16 ] = \
	{ 0xdc, 0xa7, 0x40, 0xc8, 0xc0, 0x42, 0x10, 0x1a, 0xb4, 0xb9, 0x08, 0x00, 0x2b, 0x2f, 0xe1, 0x82 };

uint8_t libfmapi_service_provider_identifier_wab_wrapped_entry_identifier[ 16 ] = \
	{ 0xc0, 0x91, 0xad, 0xd3, 0x51, 0x9d, 0xcf, 0x11, 0xa4, 0xa9, 0x00, 0xaa, 0x00, 0x47, 0xfa, 0xa4 };

#if defined( HAVE_DEBUG_OUTPUT )

/* The service provider identifiers
 */
libfmapi_class_identifier_definition_t libfmapi_service_provider_identifier_definitions[ ] = {
	{ libfmapi_service_provider_identifier_one_off_entry_identifier,	"One-off entry identifier" },
	{ libfmapi_service_provider_identifier_x500_address,			"X500 address" },
	{ libfmapi_service_provider_identifier_wab_wrapped_entry_identifier,	"WAB wrapped entry identifier" },

	{ libfmapi_class_identifier_unknown,					"Unknown" } };

#endif

#if defined( HAVE_DEBUG_OUTPUT )

/* Retrieves a string containing the name of the service provider identifier
 */
const char *libfmapi_service_provider_identifier_get_name(
             uint8_t *service_provider_identifier )
{
	int iterator = 0;

	if( service_provider_identifier == NULL )
	{
		return( "Invalid service provider identifier" );
	}
	while( memory_compare(
	        ( libfmapi_service_provider_identifier_definitions[ iterator ] ).identifier,
	        libfmapi_class_identifier_unknown,
	        16 ) != 0 )
	{
		if( memory_compare(
		     ( libfmapi_service_provider_identifier_definitions[ iterator ] ).identifier,
		     service_provider_identifier,
		     16 ) == 0 )
		{
			break;
		}
		iterator++;
	}
	return(
	 ( libfmapi_service_provider_identifier_definitions[ iterator ] ).name );
}

#endif