mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 15:10:26 +09:00
rsa: crash in br_i32_decode() called from rsa_gen_key_prop()
Fixes problem for unaligned 32bit big-endian access in lib/rsa/rsa-keyprop.c. Exchanges br_i32_decode() with get_unaligned_be32(). This will keep the unaligned access for architectures capable and will do some byte-shift magic for the not so capable ones. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-by: Robert Reither <robert.reither@external.thalesgroup.com> Remove unused include. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
00e5fda006
commit
8479333ce7
@ -12,9 +12,9 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <asm/byteorder.h>
|
|
||||||
#include <crypto/internal/rsa.h>
|
#include <crypto/internal/rsa.h>
|
||||||
#include <u-boot/rsa-mod-exp.h>
|
#include <u-boot/rsa-mod-exp.h>
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* br_dec16be() - Convert 16-bit big-endian integer to native
|
* br_dec16be() - Convert 16-bit big-endian integer to native
|
||||||
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
static unsigned br_dec16be(const void *src)
|
static unsigned br_dec16be(const void *src)
|
||||||
{
|
{
|
||||||
return be16_to_cpup(src);
|
return get_unaligned_be16(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +33,7 @@ static unsigned br_dec16be(const void *src)
|
|||||||
*/
|
*/
|
||||||
static uint32_t br_dec32be(const void *src)
|
static uint32_t br_dec32be(const void *src)
|
||||||
{
|
{
|
||||||
return be32_to_cpup(src);
|
return get_unaligned_be32(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user