Import gcrypt public-key cryptography and implement signature checking.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-01-11 21:32:42 +01:00
parent 535714bdcf
commit 5e3b8dcbb5
238 changed files with 40500 additions and 417 deletions

View file

@ -21,13 +21,14 @@
#include <grub/misc.h>
#include <grub/file.h>
#include <sys/types.h>
typedef struct grub_file FILE;
#define EOF -1
static inline int
snprintf (char *str, size_t n, const char *fmt, ...)
snprintf (char *str, grub_size_t n, const char *fmt, ...)
{
va_list ap;
int ret;

View file

@ -21,6 +21,8 @@
#include <grub/misc.h>
#define HAVE_STRCASECMP 1
static inline grub_size_t
strlen (const char *s)
{
@ -54,6 +56,12 @@ memcmp (const void *s1, const void *s2, size_t n)
#endif
static inline void
bcopy (const void *src, void *dest, grub_size_t n)
{
grub_memcpy (dest, src, n);
}
static inline char *
strcpy (char *dest, const char *src)
{
@ -73,7 +81,7 @@ strchr (const char *s, int c)
}
static inline char *
strncpy (char *dest, const char *src, size_t n)
strncpy (char *dest, const char *src, grub_size_t n)
{
return grub_strncpy (dest, src, n);
}
@ -85,7 +93,7 @@ strcat (char *dest, const char *src)
}
static inline char *
strncat (char *dest, const char *src, size_t n)
strncat (char *dest, const char *src, grub_size_t n)
{
return grub_strncat (dest, src, n);
}
@ -97,7 +105,7 @@ strcoll (const char *s1, const char *s2)
}
static inline void *
memchr (const void *s, int c, size_t n)
memchr (const void *s, int c, grub_size_t n)
{
return grub_memchr (s, c, n);
}

View file

@ -42,6 +42,15 @@ typedef grub_int16_t int16_t;
typedef grub_int32_t int32_t;
typedef grub_int64_t int64_t;
#define HAVE_U64_TYPEDEF 1
typedef grub_uint64_t u64;
#define SIZEOF_UNSIGNED_LONG GRUB_CPU_SIZEOF_LONG
#define SIZEOF_UNSIGNED_INT 4
#define SIZEOF_UNSIGNED_LONG_LONG 8
#define SIZEOF_UNSIGNED_SHORT 2
#define SIZEOF_UINT64_T 8
#ifdef GRUB_CPU_WORDS_BIGENDIAN
#define WORDS_BIGENDIAN
#else