Commit f0d386c9 authored by cRTrn13's avatar cRTrn13

keyfile -> configfile

parent 8ce08d0d
......@@ -10,7 +10,7 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path)
// open aacs decryptor if present
bd->aacs = NULL;
if ((bd->h_libaacs = dlopen("libaacs", RTLD_NOW))) {
if ((bd->h_libaacs = dlopen("libaacs.so", RTLD_NOW))) {
typedef AACS_KEYS* (*fptr)();
fptr fptr_s = dlsym(bd->h_libaacs, "aacs_open");
......
......@@ -8,6 +8,8 @@
#include "file/file.h"
#include "libaacs/aacs.h"
typedef int* (*fptr_int)();
typedef struct bluray BLURAY;
struct bluray {
char device_path[100];
......@@ -16,7 +18,8 @@ struct bluray {
uint64_t s_size;
off_t s_pos;
AACS_KEYS *aacs;
void *libaacs_h, *libbdplus_h;
void *h_libaacs, *h_libbdplus;
fptr_int libaacs_decrypt_unit;
};
BLURAY *bd_open(const char* device_path, const char* keyfile_path);
......
#include "keyfile.h"
#include "configfile.h"
#include "file.h"
#include "../util/macro.h"
uint8_t *keyfile_record(KEYFILE *kf, enum keyfile_types type, uint16_t *entries, size_t *entry_len)
uint8_t *configfile_record(CONFIGFILE *kf, enum configfile_types type, uint16_t *entries, size_t *entry_len)
{
size_t pos = 0, len = 0;
......@@ -27,10 +27,10 @@ uint8_t *keyfile_record(KEYFILE *kf, enum keyfile_types type, uint16_t *entries,
return NULL;
}
KEYFILE *keyfile_open(const char *path)
CONFIGFILE *configfile_open(const char *path)
{
FILE_H *fp = NULL;
KEYFILE *kf = malloc(sizeof(KEYFILE));
CONFIGFILE *kf = malloc(sizeof(CONFIGFILE));
if ((fp = file_open(path, "rb"))) {
file_seek(fp, 0, SEEK_END);
......@@ -51,7 +51,7 @@ KEYFILE *keyfile_open(const char *path)
return NULL;
}
void keyfile_close(KEYFILE *kf)
void configfile_close(CONFIGFILE *kf)
{
X_FREE(kf->buf);
X_FREE(kf);
......
#ifndef KEYFILE_H_
#define KEYFILE_H_
#ifndef CONFIGFILE_H_
#define CONFIGFILE_H_
#include <stdint.h>
#include <unistd.h>
typedef struct keyfile KEYFILE;
struct keyfile {
typedef struct configfile CONFIGFILE;
struct configfile {
size_t size;
uint8_t *buf;
};
enum keyfile_types {
enum configfile_types {
KF_DK_ARRAY = 0x01,
KF_PK_ARRAY,
KF_HOST_PRIV_KEY,
......@@ -20,9 +20,9 @@ enum keyfile_types {
KF_HOST_KEY_POINT
};
KEYFILE *keyfile_open(const char *path);
void keyfile_close(KEYFILE *kf);
uint8_t *keyfile_record(KEYFILE *kf, enum keyfile_types type, uint16_t *entries, size_t *entry_len);
CONFIGFILE *configfile_open(const char *path);
void configfile_close(CONFIGFILE *kf);
uint8_t *configfile_record(CONFIGFILE *kf, enum configfile_types type, uint16_t *entries, size_t *entry_len);
/* Keys are stored in a binary file in a record format which is queried from this code
*
......@@ -38,4 +38,4 @@ uint8_t *keyfile_record(KEYFILE *kf, enum keyfile_types type, uint16_t *entries,
*
*/
#endif /* KEYFILE_H_ */
#endif /* CONFIGFILE_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment