This file is indexed.

/usr/include/freeipmi/util/ipmi-rmcpplus-util.h is in libfreeipmi-dev 0.8.12-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
   Copyright (C) 2003-2010 FreeIPMI Core Team

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program 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 General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 */

#ifndef _IPMI_RMCPPLUS_UTIL_H
#define _IPMI_RMCPPLUS_UTIL_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <freeipmi/fiid/fiid.h>

/* return length of data written into buffer on success, -1 on error */
int ipmi_calculate_sik (uint8_t authentication_algorithm,
                        const void *k_g,
                        unsigned int k_g_len,
                        const void *remote_console_random_number,
                        unsigned int remote_console_random_number_len,
                        const void *managed_system_random_number,
                        unsigned int managed_system_random_number_len,
                        uint8_t name_only_lookup,
                        uint8_t requested_privilege_level,
                        const char *user_name,
                        unsigned int user_name_len,
                        void *sik,
                        unsigned int sik_len);

/* return length of data written into buffer on success, -1 on error */
int ipmi_calculate_k1 (uint8_t authentication_algorithm,
                       const void *sik_key,
                       unsigned int sik_key_len,
                       void *k1,
                       unsigned int k1_len);

/* return length of data written into buffer on success, -1 on error */
int ipmi_calculate_k2 (uint8_t authentication_algorithm,
                       const void *sik_key,
                       unsigned int sik_key_len,
                       void *k2,
                       unsigned int k2_len);

/* returns 0 on success, -1 on error.
 *
 * sik_key, integrity_key, confidentiality_key should be pointers to
 * buffers.  length parameters should contains lengths of buffers.
 *
 * returned pointers and lengths reflect appropriate keys for
 * remaining rmcpplus communication.
 */
int ipmi_calculate_rmcpplus_session_keys (uint8_t authentication_algorithm,
                                          uint8_t integrity_algorithm,
                                          uint8_t confidentiality_algorithm,
                                          const void *authentication_code_data,
                                          unsigned int authentication_code_data_len,
                                          const void *k_g,
                                          unsigned int k_g_len,
                                          const void *remote_console_random_number,
                                          unsigned int remote_console_random_number_len,
                                          const void *managed_system_random_number,
                                          unsigned int managed_system_random_number_len,
                                          uint8_t name_only_lookup,
                                          uint8_t requested_privilege_level,
                                          const char *user_name,
                                          unsigned int user_name_len,
                                          void **sik_key,
                                          unsigned int *sik_key_len,
                                          void **integrity_key,
                                          unsigned int *integrity_key_len,
                                          void **confidentiality_key,
                                          unsigned int *confidentiality_key_len);

/* return length of data written into buffer on success, -1 on error */
int ipmi_calculate_rakp_3_key_exchange_authentication_code (uint8_t authentication_algorithm,
                                                            const void *k_uid,
                                                            unsigned int k_uid_len,
                                                            const void *managed_system_random_number,
                                                            unsigned int managed_system_random_number_len,
                                                            uint32_t remote_console_session_id,
                                                            uint8_t name_only_lookup,
                                                            uint8_t requested_privilege_level,
                                                            const char *user_name,
                                                            unsigned int user_name_len,
                                                            void *key_exchange_authentication_code,
                                                            unsigned int key_exchange_authentication_code_len);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_payload_pad (uint8_t confidentiality_algorithm,
                                     fiid_obj_t obj_rmcpplus_payload);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_integrity_pad (fiid_obj_t obj_rmcpplus_session_trlr);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_rakp_2_key_exchange_authentication_code (uint8_t authentication_algorithm,
                                                                 const void *k_uid,
                                                                 unsigned int k_uid_len,
                                                                 uint32_t remote_console_session_id,
                                                                 uint32_t managed_system_session_id,
                                                                 const void *remote_console_random_number,
                                                                 unsigned int remote_console_random_number_len,
                                                                 const void *managed_system_random_number,
                                                                 unsigned int managed_system_random_number_len,
                                                                 const void *managed_system_guid,
                                                                 unsigned int managed_system_guid_len,
                                                                 uint8_t name_only_lookup,
                                                                 uint8_t requested_privilege_level,
                                                                 const char *user_name,
                                                                 unsigned int user_name_len,
                                                                 fiid_obj_t obj_cmd);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_rakp_4_integrity_check_value (uint8_t authentication_algorithm,
                                                      const void *sik_key,
                                                      unsigned int sik_key_len,
                                                      const void *remote_console_random_number,
                                                      unsigned int remote_console_random_number_len,
                                                      uint32_t managed_system_session_id,
                                                      const void *managed_system_guid,
                                                      unsigned int managed_system_guid_len,
                                                      fiid_obj_t obj_cmd);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_packet_session_authentication_code (uint8_t integrity_algorithm,
                                                            const void *pkt,
                                                            unsigned int pkt_len,
                                                            const void *integrity_key,
                                                            unsigned int integrity_key_len,
                                                            const void *authentication_code_data,
                                                            unsigned int authentication_code_data_len,
                                                            fiid_obj_t obj_rmcpplus_session_trlr);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_payload_type (fiid_obj_t obj_rmcpplus_session_hdr,
                                      uint8_t payload_type);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_status_code (fiid_obj_t obj_cmd,
                                     uint8_t status_code);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_message_tag (fiid_obj_t obj_cmd,
                                     uint8_t message_tag);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_remote_console_session_id (fiid_obj_t obj_cmd,
                                                   uint32_t remote_console_session_id);

/* returns 1 on pass, 0 on fail, -1 on error */
int ipmi_rmcpplus_check_session_id (fiid_obj_t obj_rmcpplus_session_hdr,
                                    uint32_t session_id);

int ipmi_rmcpplus_calculate_payload_type (const void *pkt,
                                          unsigned int pkt_len,
                                          uint8_t *payload_type);

#ifdef __cplusplus
}
#endif

#endif