/*
* GRUB -- GRand Unified Bootloader
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
enum bblk_hash_types_t {
BBLK_NO_HASH = 0,
};
/* Extra header preceding the payloads at the end of the bootblock. */
typedef struct _bb_extra_header {
#pragma pack(1)
typedef struct _extended_info {
} bblk_einfo_t;
#pragma pack()
typedef struct _hashing_function {
unsigned int type;
unsigned int size;
void (*compute_hash)(void *, const void *, unsigned int);
} bblk_hash_t;
typedef struct _hashing_source {
unsigned char *src_buf;
unsigned int src_size;
} bblk_hs_t;
int prepare_and_write_einfo(unsigned char *, char *, bblk_hs_t *,
/*************************************************************************/
void
{
unsigned char *digest;
}
/*************************************************************************/
static int
{
return (-1);
return (0);
}
int
{
unsigned char *data;
/*
* 'dest' might be both containing the buffer we want to hash and
* containing our einfo structure: delay any update of it after the
* hashing has been calculated.
*/
hash_off = sizeof (bblk_einfo_t);
"not enough space\n"));
return (-1);
}
if (doit) {
} else {
}
}
"string is empty\n"));
return (-1);
}
if (doit)
"not enough space\n"));
return (-1);
}
if (!doit) {
return (0);
}
return (0);
}
/*************************************************************************/
/*
* Common functions to deal with the fake-multiboot encapsulation of the
* bootblock and the location of the extra information area.
*/
/* mboot checksum routine. */
{
int i;
return (-cksum);
}
/*
* Given a pointer to the extra area, add the extended information structure
* encapsulated by a bb_header_ext_t structure.
*/
int
{
unsigned char *dest;
int ret;
return (1);
}
/* Reserve space for the extra header. */
/* Place the extended information structure. */
&used_space, doit);
if (ret != 0) {
if (doit)
"versioning information\n"));
return(1);
}
if (!doit) {
if (space_usedp)
return (0);
}
/* Fill the extended information associated header. */
return (0);
}
/*************************************************************************/
static void
{
== 0) {
sizeof (*ext_hdr);
if (verbosity)
printf("Size of versioning info: %d\n",
*new_core_size - core_size);
}
}
static void
{
== 0) {
if (verbosity)
printf("Size before versioning: %d, after: %d\n",
sizeof (*ext_hdr));
}
}