kernel: add CONFIG_KSU_DEBUG (#19)
* Kconfig: add KSU_DEBUG * print alert on debug mode * allow shell by default * store signature to var on debug mode * format * export as module_param * rename apk_sign to kernelsu
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include "apk_sign.h"
|
||||
#include "klog.h"
|
||||
|
||||
static int check_v2_signature(char *path, unsigned expected_size,
|
||||
static __always_inline int check_v2_signature(char *path, unsigned expected_size,
|
||||
unsigned expected_hash)
|
||||
{
|
||||
unsigned char buffer[0x11] = { 0 };
|
||||
@@ -121,7 +122,25 @@ clean:
|
||||
return sign;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KSU_DEBUG
|
||||
|
||||
unsigned ksu_expected_size = EXPECTED_SIZE;
|
||||
unsigned ksu_expected_hash = EXPECTED_HASH;
|
||||
|
||||
module_param(ksu_expected_size, uint, S_IRUSR | S_IWUSR);
|
||||
module_param(ksu_expected_hash, uint, S_IRUSR | S_IWUSR);
|
||||
|
||||
int is_manager_apk(char *path)
|
||||
{
|
||||
return check_v2_signature(path, ksu_expected_size, ksu_expected_hash);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
||||
int is_manager_apk(char *path)
|
||||
{
|
||||
return check_v2_signature(path, EXPECTED_SIZE, EXPECTED_HASH);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user