2009-11-09 16:13:17 +00:00
|
|
|
/*
|
|
|
|
* GRUB -- GRand Unified Bootloader
|
|
|
|
* Copyright (C) 1999, 2001, 2002, 2003, 2007,
|
|
|
|
* 2008, 2009 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* GRUB 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 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/>.
|
|
|
|
*/
|
|
|
|
#include <grub/crypto.h>
|
|
|
|
#include <grub/misc.h>
|
2009-11-10 00:01:11 +00:00
|
|
|
#include <grub/mm.h>
|
2009-11-09 16:13:17 +00:00
|
|
|
|
2009-11-10 00:01:11 +00:00
|
|
|
gcry_cipher_spec_t *grub_ciphers = NULL;
|
|
|
|
gcry_md_spec_t *grub_digests = NULL;
|
2009-11-09 16:13:17 +00:00
|
|
|
|
|
|
|
/* Based on libgcrypt-1.4.4/src/misc.c. */
|
|
|
|
void
|
|
|
|
grub_burn_stack (grub_size_t size)
|
|
|
|
{
|
|
|
|
char buf[64];
|
|
|
|
|
|
|
|
grub_memset (buf, 0, sizeof (buf));
|
2009-11-10 19:46:05 +00:00
|
|
|
if (size > sizeof (buf))
|
|
|
|
grub_burn_stack (size - sizeof (buf));
|
2009-11-09 16:13:17 +00:00
|
|
|
}
|