aboutsummaryrefslogtreecommitdiff
path: root/grub-core/lib/crypto.c
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-01-31 02:47:37 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2013-03-30 17:41:06 +0200
commita658a0c5e3a4fe5c61fc9ae26417a33e0f69efff (patch)
treea2cad6d1cf96e429cdc26567fd65a906495a5143 /grub-core/lib/crypto.c
parent51429b4eded131e21c7b20475e9f3da6c2c77907 (diff)
parentf4243e63fd6e9588757edb1cca3cc3d88bc22faf (diff)
Imported Debian patch 2.00+bzr4617+20130130-0linaro4debian/2.00+bzr4617+20130130-0linaro4
Diffstat (limited to 'grub-core/lib/crypto.c')
-rw-r--r--grub-core/lib/crypto.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
index f4b13ed..dce5eda 100644
--- a/grub-core/lib/crypto.c
+++ b/grub-core/lib/crypto.c
@@ -23,6 +23,7 @@
#include <grub/term.h>
#include <grub/dl.h>
#include <grub/i18n.h>
+#include <grub/env.h>
#ifdef GRUB_UTIL
#include <termios.h>
@@ -56,6 +57,38 @@ grub_burn_stack (grub_size_t size)
grub_burn_stack (size - sizeof (buf));
}
+void
+_gcry_burn_stack (int size)
+{
+ grub_burn_stack (size);
+}
+
+void __attribute__ ((noreturn))
+_gcry_assert_failed (const char *expr, const char *file, int line,
+ const char *func)
+
+{
+ grub_fatal ("assertion %s at %s:%d (%s) failed\n", expr, file, line, func);
+}
+
+
+void _gcry_log_error (const char *fmt, ...)
+{
+ va_list args;
+ const char *debug = grub_env_get ("debug");
+
+ if (! debug)
+ return;
+
+ if (grub_strword (debug, "all") || grub_strword (debug, "gcrypt"))
+ {
+ grub_printf ("gcrypt error: ");
+ va_start (args, fmt);
+ grub_vprintf (fmt, args);
+ va_end (args);
+ grub_refresh ();
+ }
+}
void
grub_cipher_register (gcry_cipher_spec_t *cipher)
@@ -477,3 +510,4 @@ grub_password_get (char buf[], unsigned buf_size)
return (key != '\e');
#endif
}
+