mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
- now compiled with devkitppc r39-2 (GCC 11) and libogc 2.3.1-1
- updated libwolfssl - many thanks to blackb0x
This commit is contained in:
parent
ec5bd48a5b
commit
12d21fa0a7
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@ -21,22 +21,22 @@ jobs:
|
|||||||
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
|
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
|
||||||
run: |
|
run: |
|
||||||
mkdir cache && cd cache
|
mkdir cache && cd cache
|
||||||
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r36-1-linux.pkg.tar.xz"
|
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r39-2-linux_x86_64.pkg.tar.xz"
|
||||||
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitppc-rules-1.0.1-1-any.pkg.tar.xz"
|
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitppc-rules-1.1.1-1-any.pkg.tar.xz"
|
||||||
wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-1.8.24-1-any.pkg.tar.xz"
|
wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-2.3.1-1-any.pkg.tar.xz"
|
||||||
wget "https://wii.leseratte10.de/devkitPro/file.php/general-tools-1.2.0-1-linux.pkg.tar.xz"
|
wget "https://wii.leseratte10.de/devkitPro/file.php/general-tools-1.2.0-2-linux_x86_64.pkg.tar.xz"
|
||||||
wget "https://wii.leseratte10.de/devkitPro/file.php/gamecube-tools-1.0.2-1-linux.pkg.tar.xz"
|
wget "https://wii.leseratte10.de/devkitPro/file.php/gamecube-tools-1.0.3-1-linux_x86_64.pkg.tar.xz"
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Extract devkitPPC r36, libogc 1.8.24, bin2s and elf2dol
|
- name: Extract devkitPPC r36, libogc 1.8.24, bin2s and elf2dol
|
||||||
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
|
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
|
||||||
run: |
|
run: |
|
||||||
tar -xf cache/devkitPPC-r36-1-linux.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
|
tar -xf cache/devkitPPC-r39-2-linux_x86_64.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
|
||||||
tar -xf cache/devkitppc-rules-1.0.1-1-any.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
|
tar -xf cache/devkitppc-rules-1.1.1-1-any.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
|
||||||
tar -xf cache/libogc-1.8.24-1-any.pkg.tar.xz opt/devkitpro/libogc --strip-components=1
|
tar -xf cache/libogc-2.3.1-1-any.pkg.tar.xz opt/devkitpro/libogc --strip-components=1
|
||||||
tar -xf cache/general-tools-1.2.0-1-linux.pkg.tar.xz opt/devkitpro/tools/bin/bin2s --strip-components=4
|
tar -xf cache/general-tools-1.2.0-2-linux_x86_64.pkg.tar.xz opt/devkitpro/tools/bin/bin2s --strip-components=4
|
||||||
sudo cp bin2s /usr/local/bin/bin2s
|
sudo cp bin2s /usr/local/bin/bin2s
|
||||||
tar -xf cache/gamecube-tools-1.0.2-1-linux.pkg.tar.xz opt/devkitpro/tools/bin/elf2dol --strip-components=4
|
tar -xf cache/gamecube-tools-1.0.3-1-linux_x86_64.pkg.tar.xz opt/devkitpro/tools/bin/elf2dol --strip-components=4
|
||||||
sudo cp elf2dol /usr/local/bin/elf2dol
|
sudo cp elf2dol /usr/local/bin/elf2dol
|
||||||
|
|
||||||
- name: Compile
|
- name: Compile
|
||||||
|
@ -45,6 +45,7 @@ DATA := data \
|
|||||||
data/help \
|
data/help \
|
||||||
data/sounds
|
data/sounds
|
||||||
INCLUDES := source
|
INCLUDES := source
|
||||||
|
FALSE_POSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# Default build shell script options
|
# Default build shell script options
|
||||||
@ -53,7 +54,7 @@ ios := 249
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
CFLAGS = -g -ggdb -O2 -Wall -Wno-multichar -Wno-address-of-packed-member -Wextra $(MACHDEP) $(INCLUDE) -D_GNU_SOURCE -DHAVE_CONFIG_H
|
CFLAGS = -g -ggdb -O2 -Wall -Wno-multichar -Wno-address-of-packed-member -Wextra $(FALSE_POSITIVES) $(MACHDEP) $(INCLUDE) -D_GNU_SOURCE -DHAVE_CONFIG_H
|
||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,wiiuse_register
|
LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,wiiuse_register
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 4.3 MiB After Width: | Height: | Size: 4.3 MiB |
@ -35,8 +35,9 @@ INCLUDES :=
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
FALSE_POSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
|
||||||
MACHDEP := -mno-eabi -mno-sdata -mcpu=750
|
MACHDEP := -mno-eabi -mno-sdata -mcpu=750
|
||||||
CFLAGS := -Wall -W -O1 -ffreestanding -std=gnu99 -Wstrict-aliasing=2 $(MACHDEP) $(INCLUDE)
|
CFLAGS := -Wall -W -O1 -ffreestanding -std=gnu99 -Wstrict-aliasing=2 $(FALSE_POSITIVES) $(MACHDEP) $(INCLUDE)
|
||||||
LDFLAGS := -nostartfiles -nostdlib $(MACHDEP)
|
LDFLAGS := -nostartfiles -nostdlib $(MACHDEP)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
@ -10,8 +10,9 @@ OBJCOPY = $(PREFIX)objcopy
|
|||||||
RANLIB = $(PREFIX)ranlib
|
RANLIB = $(PREFIX)ranlib
|
||||||
STRIP = $(PREFIX)strip
|
STRIP = $(PREFIX)strip
|
||||||
|
|
||||||
|
FALSE_POSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
|
||||||
MACHDEP = -mcpu=750 -mno-eabi
|
MACHDEP = -mcpu=750 -mno-eabi
|
||||||
CFLAGS = $(MACHDEP) -O1 -Werror -Wall -pipe -mno-sdata
|
CFLAGS = $(FALSE_POSITIVES) $(MACHDEP) -O1 -Werror -Wall -pipe -mno-sdata
|
||||||
LDFLAGS = $(MACHDEP) -n -nostartfiles -nostdlib -Wl,-T,link.ld -L.
|
LDFLAGS = $(MACHDEP) -n -nostartfiles -nostdlib -Wl,-T,link.ld -L.
|
||||||
ASFLAGS = -D_LANGUAGE_ASSEMBLY -DHW_RVL -x assembler-with-cpp
|
ASFLAGS = -D_LANGUAGE_ASSEMBLY -DHW_RVL -x assembler-with-cpp
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ INCLUDES := source
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
CFLAGS = -g -ggdb -O1 -Wall -Wextra -Wno-shift-negative-value $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H
|
FALSE_POSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
|
||||||
|
CFLAGS = -g -ggdb -O1 -Wall -Wextra -Wno-shift-negative-value $(FALSE_POSITIVES) $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H
|
||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80A80000
|
LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80A80000
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include "videopatch.h"
|
#include "videopatch.h"
|
||||||
#include "video_tinyload.h"
|
#include "video_tinyload.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
void *dolchunkoffset[18];
|
void *dolchunkoffset[18];
|
||||||
u32 dolchunksize[18];
|
u32 dolchunksize[18];
|
||||||
u32 dolchunkcount;
|
u32 dolchunkcount;
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
#define EXT_ADDR_CFG ((vu32*)0x90100000)
|
#define EXT_ADDR_CFG ((vu32*)0x90100000)
|
||||||
using namespace std;
|
|
||||||
IOS_Info CurrentIOS;
|
IOS_Info CurrentIOS;
|
||||||
|
|
||||||
/* Boot Variables */
|
/* Boot Variables */
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define IMET_MAX_NAME_LEN 0x2a
|
#define IMET_MAX_NAME_LEN 0x2a
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
|
|
||||||
#define IMET_MAX_NAME_LEN 0x2a
|
#define IMET_MAX_NAME_LEN 0x2a
|
||||||
|
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,8 @@ typedef struct _uid
|
|||||||
u16 uid;
|
u16 uid;
|
||||||
} ATTRIBUTE_PACKED uid;
|
} ATTRIBUTE_PACKED uid;
|
||||||
|
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
class Nand
|
class Nand
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ string GCTCheats::getCheatComment(unsigned int nr)
|
|||||||
//creates gct from internal array
|
//creates gct from internal array
|
||||||
int GCTCheats::createGCT(const char * filename)
|
int GCTCheats::createGCT(const char * filename)
|
||||||
{
|
{
|
||||||
ofstream filestr;
|
std::ofstream filestr;
|
||||||
filestr.open(filename);
|
filestr.open(filename);
|
||||||
if (filestr.fail()) return 0;
|
if (filestr.fail()) return 0;
|
||||||
|
|
||||||
@ -93,33 +93,33 @@ int GCTCheats::createTXT(const char * filename)
|
|||||||
{
|
{
|
||||||
|
|
||||||
// save gct file
|
// save gct file
|
||||||
fstream file;
|
std::fstream file;
|
||||||
file.open(filename,ios::out);
|
file.open(filename, std::ios::out);
|
||||||
|
|
||||||
file << sGameID << endl;
|
file << sGameID << std::endl;
|
||||||
file << sGameTitle << endl << endl;
|
file << sGameTitle << std::endl << std::endl;
|
||||||
|
|
||||||
for (unsigned int i=0; i < iCntCheats; ++i)
|
for (unsigned int i=0; i < iCntCheats; ++i)
|
||||||
if (sCheatSelected[i])
|
if (sCheatSelected[i])
|
||||||
{
|
{
|
||||||
file << sCheatName[i] << endl;
|
file << sCheatName[i] << std::endl;
|
||||||
for (unsigned int j=0; j+8 < sCheats[i].size(); j+=16)
|
for (unsigned int j=0; j+8 < sCheats[i].size(); j+=16)
|
||||||
file << sCheats[i].substr(j,8) << " " << sCheats[i].substr(j+8,8) << endl;
|
file << sCheats[i].substr(j,8) << " " << sCheats[i].substr(j+8,8) << std::endl;
|
||||||
|
|
||||||
file << "#selected#" << sCheatComment[i] << endl;
|
file << "#selected#" << sCheatComment[i] << std::endl;
|
||||||
file << endl;
|
file << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i=0; i < iCntCheats; ++i)
|
for (unsigned int i=0; i < iCntCheats; ++i)
|
||||||
if (!sCheatSelected[i])
|
if (!sCheatSelected[i])
|
||||||
{
|
{
|
||||||
file << sCheatName[i] << endl;
|
file << sCheatName[i] << std::endl;
|
||||||
for (unsigned int j=0; j+8 < sCheats[i].size(); j+=16)
|
for (unsigned int j=0; j+8 < sCheats[i].size(); j+=16)
|
||||||
file << sCheats[i].substr(j,8) << " " << sCheats[i].substr(j+8,8) << endl;
|
file << sCheats[i].substr(j,8) << " " << sCheats[i].substr(j+8,8) << std::endl;
|
||||||
|
|
||||||
if (sCheatComment[i].size() > 1)
|
if (sCheatComment[i].size() > 1)
|
||||||
file << sCheatComment[i] << endl;
|
file << sCheatComment[i] << std::endl;
|
||||||
file << endl;
|
file << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
@ -131,17 +131,17 @@ int GCTCheats::openTxtfile(const char * filename)
|
|||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
ifstream filestr;
|
std::ifstream filestr;
|
||||||
filestr.open(filename);
|
filestr.open(filename);
|
||||||
if (filestr.fail()) return 0;
|
if (filestr.fail()) return 0;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
string str;
|
string str;
|
||||||
|
|
||||||
filestr.seekg(0,ios_base::end);
|
filestr.seekg(0, std::ios_base::end);
|
||||||
int size = filestr.tellg();
|
int size = filestr.tellg();
|
||||||
if (size <= 0) return -1;
|
if (size <= 0) return -1;
|
||||||
filestr.seekg(0,ios_base::beg);
|
filestr.seekg(0, std::ios_base::beg);
|
||||||
|
|
||||||
getline(filestr,sGameID);
|
getline(filestr,sGameID);
|
||||||
if (sGameID[sGameID.length() - 1] == '\r')
|
if (sGameID[sGameID.length() - 1] == '\r')
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#define MAXCHEATS 100
|
#define MAXCHEATS 100
|
||||||
|
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
|
||||||
//!Handles Ocarina TXT Cheatfiles
|
//!Handles Ocarina TXT Cheatfiles
|
||||||
class GCTCheats {
|
class GCTCheats {
|
||||||
|
@ -9,25 +9,25 @@
|
|||||||
static const char *g_whitespaces = " \f\n\r\t\v";
|
static const char *g_whitespaces = " \f\n\r\t\v";
|
||||||
static const int g_floatPrecision = 10;
|
static const int g_floatPrecision = 10;
|
||||||
|
|
||||||
const string Config::emptyString;
|
const std::string Config::emptyString;
|
||||||
|
|
||||||
Config::Config(void) :
|
Config::Config(void) :
|
||||||
m_loaded(false), m_changed(false), m_domains(), m_filename(), m_iter()
|
m_loaded(false), m_changed(false), m_domains(), m_filename(), m_iter()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static string trimEnd(string line)
|
static std::string trimEnd(std::string line)
|
||||||
{
|
{
|
||||||
string::size_type i = line.find_last_not_of(g_whitespaces);
|
std::string::size_type i = line.find_last_not_of(g_whitespaces);
|
||||||
if (i == string::npos) line.clear();
|
if (i == std::string::npos) line.clear();
|
||||||
else line.resize(i + 1);
|
else line.resize(i + 1);
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
static string trim(string line)
|
static std::string trim(std::string line)
|
||||||
{
|
{
|
||||||
string::size_type i = line.find_last_not_of(g_whitespaces);
|
std::string::size_type i = line.find_last_not_of(g_whitespaces);
|
||||||
if (i == string::npos)
|
if (i == std::string::npos)
|
||||||
{
|
{
|
||||||
line.clear();
|
line.clear();
|
||||||
return line;
|
return line;
|
||||||
@ -40,13 +40,13 @@ static string trim(string line)
|
|||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
static string unescNewlines(const string &text)
|
static std::string unescNewlines(const std::string &text)
|
||||||
{
|
{
|
||||||
string s;
|
std::string s;
|
||||||
bool escaping = false;
|
bool escaping = false;
|
||||||
|
|
||||||
s.reserve(text.size());
|
s.reserve(text.size());
|
||||||
for (string::size_type i = 0; i < text.size(); ++i)
|
for (std::string::size_type i = 0; i < text.size(); ++i)
|
||||||
{
|
{
|
||||||
if (escaping)
|
if (escaping)
|
||||||
{
|
{
|
||||||
@ -68,12 +68,12 @@ static string unescNewlines(const string &text)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static string escNewlines(const string &text)
|
static std::string escNewlines(const std::string &text)
|
||||||
{
|
{
|
||||||
string s;
|
std::string s;
|
||||||
|
|
||||||
s.reserve(text.size());
|
s.reserve(text.size());
|
||||||
for (string::size_type i = 0; i < text.size(); ++i)
|
for (std::string::size_type i = 0; i < text.size(); ++i)
|
||||||
{
|
{
|
||||||
switch (text[i])
|
switch (text[i])
|
||||||
{
|
{
|
||||||
@ -92,17 +92,17 @@ static string escNewlines(const string &text)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::hasDomain(const string &domain) const
|
bool Config::hasDomain(const std::string &domain) const
|
||||||
{
|
{
|
||||||
return m_domains.find(domain) != m_domains.end();
|
return m_domains.find(domain) != m_domains.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::copyDomain(const string &dst, const string &src)
|
void Config::copyDomain(const std::string &dst, const std::string &src)
|
||||||
{
|
{
|
||||||
m_domains[upperCase(dst)] = m_domains[upperCase(src)];
|
m_domains[upperCase(dst)] = m_domains[upperCase(src)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const string &Config::firstDomain(void)
|
const std::string &Config::firstDomain(void)
|
||||||
{
|
{
|
||||||
m_iter = m_domains.begin();
|
m_iter = m_domains.begin();
|
||||||
if (m_iter == m_domains.end())
|
if (m_iter == m_domains.end())
|
||||||
@ -110,7 +110,7 @@ const string &Config::firstDomain(void)
|
|||||||
return m_iter->first;
|
return m_iter->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string &Config::nextDomain(void)
|
const std::string &Config::nextDomain(void)
|
||||||
{
|
{
|
||||||
++m_iter;
|
++m_iter;
|
||||||
if (m_iter == m_domains.end())
|
if (m_iter == m_domains.end())
|
||||||
@ -118,7 +118,7 @@ const string &Config::nextDomain(void)
|
|||||||
return m_iter->first;
|
return m_iter->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string &Config::nextDomain(const string &start) const
|
const std::string &Config::nextDomain(const std::string &start) const
|
||||||
{
|
{
|
||||||
Config::DomainMap::const_iterator i;
|
Config::DomainMap::const_iterator i;
|
||||||
Config::DomainMap::const_iterator j;
|
Config::DomainMap::const_iterator j;
|
||||||
@ -132,7 +132,7 @@ const string &Config::nextDomain(const string &start) const
|
|||||||
return j != m_domains.end() ? j->first : i->first;
|
return j != m_domains.end() ? j->first : i->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string &Config::prevDomain(const string &start) const
|
const std::string &Config::prevDomain(const std::string &start) const
|
||||||
{
|
{
|
||||||
Config::DomainMap::const_iterator i;
|
Config::DomainMap::const_iterator i;
|
||||||
if (m_domains.empty())
|
if (m_domains.empty())
|
||||||
@ -148,9 +148,9 @@ bool Config::load(const char *filename)
|
|||||||
{
|
{
|
||||||
if (m_loaded && m_changed) save();
|
if (m_loaded && m_changed) save();
|
||||||
|
|
||||||
ifstream file(filename, ios::in | ios::binary);
|
std::ifstream file(filename, std::ios::in | std::ios::binary);
|
||||||
string line;
|
std::string line;
|
||||||
string domain("");
|
std::string domain("");
|
||||||
|
|
||||||
m_changed = false;
|
m_changed = false;
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
@ -161,7 +161,7 @@ bool Config::load(const char *filename)
|
|||||||
while (file.good())
|
while (file.good())
|
||||||
{
|
{
|
||||||
line.clear();
|
line.clear();
|
||||||
getline(file, line, '\n');
|
std::getline(file, line, '\n');
|
||||||
++n;
|
++n;
|
||||||
if (!file.bad() && !file.fail())
|
if (!file.bad() && !file.fail())
|
||||||
{
|
{
|
||||||
@ -169,8 +169,8 @@ bool Config::load(const char *filename)
|
|||||||
if (line.empty() || line[0] == '#' || line[0] == '\0') continue;
|
if (line.empty() || line[0] == '#' || line[0] == '\0') continue;
|
||||||
if (line[0] == '[')
|
if (line[0] == '[')
|
||||||
{
|
{
|
||||||
string::size_type i = line.find_first_of(']');
|
std::string::size_type i = line.find_first_of(']');
|
||||||
if (i != string::npos && i > 1)
|
if (i != std::string::npos && i > 1)
|
||||||
{
|
{
|
||||||
domain = upperCase(line.substr(1, i - 1));
|
domain = upperCase(line.substr(1, i - 1));
|
||||||
if (m_domains.find(domain) != m_domains.end())
|
if (m_domains.find(domain) != m_domains.end())
|
||||||
@ -180,8 +180,8 @@ bool Config::load(const char *filename)
|
|||||||
else
|
else
|
||||||
if (!domain.empty())
|
if (!domain.empty())
|
||||||
{
|
{
|
||||||
string::size_type i = line.find_first_of('=');
|
std::string::size_type i = line.find_first_of('=');
|
||||||
if (i != string::npos && i > 0)
|
if (i != std::string::npos && i > 0)
|
||||||
m_domains[domain][lowerCase(trim(line.substr(0, i)))] = unescNewlines(trim(line.substr(i + 1)));
|
m_domains[domain][lowerCase(trim(line.substr(0, i)))] = unescNewlines(trim(line.substr(i + 1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ void Config::save(bool unload)
|
|||||||
if (m_changed)
|
if (m_changed)
|
||||||
{
|
{
|
||||||
//gprintf("changed:%d\n",m_changed);
|
//gprintf("changed:%d\n",m_changed);
|
||||||
ofstream file(m_filename.c_str(), ios::out | ios::binary);
|
std::ofstream file(m_filename.c_str(), std::ios::out | std::ios::binary);
|
||||||
for (Config::DomainMap::iterator k = m_domains.begin(); k != m_domains.end(); ++k)
|
for (Config::DomainMap::iterator k = m_domains.begin(); k != m_domains.end(); ++k)
|
||||||
{
|
{
|
||||||
Config::KeyMap *m = &k->second;
|
Config::KeyMap *m = &k->second;
|
||||||
@ -231,15 +231,15 @@ void Config::groupCustomTitles(void)
|
|||||||
{
|
{
|
||||||
for (Config::DomainMap::iterator k = m_domains.begin(); k != m_domains.end(); ++k)
|
for (Config::DomainMap::iterator k = m_domains.begin(); k != m_domains.end(); ++k)
|
||||||
{
|
{
|
||||||
string uc_domain(upperCase(k->first));
|
std::string uc_domain(upperCase(k->first));
|
||||||
istringstream f(uc_domain);
|
std::istringstream f(uc_domain);
|
||||||
string s;
|
std::string s;
|
||||||
while (getline(f, s, ','))
|
while (getline(f, s, ','))
|
||||||
m_groupCustomTitles[s] = uc_domain;
|
m_groupCustomTitles[s] = uc_domain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setWString(const string &domain, const string &key, const wstringEx &val)
|
void Config::setWString(const std::string &domain, const std::string &key, const wstringEx &val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setWString %s\n", val.toUTF8().c_str());
|
//gprintf("setWString %s\n", val.toUTF8().c_str());
|
||||||
@ -247,7 +247,7 @@ void Config::setWString(const string &domain, const string &key, const wstringEx
|
|||||||
m_domains[upperCase(domain)][lowerCase(key)] = val.toUTF8();
|
m_domains[upperCase(domain)][lowerCase(key)] = val.toUTF8();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setString(const string &domain, const string &key, const string &val)
|
void Config::setString(const std::string &domain, const std::string &key, const std::string &val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setString %s\n", val.c_str());
|
//gprintf("setString %s\n", val.c_str());
|
||||||
@ -255,7 +255,7 @@ void Config::setString(const string &domain, const string &key, const string &va
|
|||||||
m_domains[upperCase(domain)][lowerCase(key)] = val;
|
m_domains[upperCase(domain)][lowerCase(key)] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setBool(const string &domain, const string &key, bool val)
|
void Config::setBool(const std::string &domain, const std::string &key, bool val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setBool %d\n", val);
|
//gprintf("setBool %d\n", val);
|
||||||
@ -263,7 +263,7 @@ void Config::setBool(const string &domain, const string &key, bool val)
|
|||||||
m_domains[upperCase(domain)][lowerCase(key)] = val ? "yes" : "no";
|
m_domains[upperCase(domain)][lowerCase(key)] = val ? "yes" : "no";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::remove(const string &domain, const string &key)
|
void Config::remove(const std::string &domain, const std::string &key)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("remove %s\n", key.c_str());
|
//gprintf("remove %s\n", key.c_str());
|
||||||
@ -271,7 +271,7 @@ void Config::remove(const string &domain, const string &key)
|
|||||||
m_domains[upperCase(domain)].erase(lowerCase(key));
|
m_domains[upperCase(domain)].erase(lowerCase(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setOptBool(const string &domain, const string &key, int val)
|
void Config::setOptBool(const std::string &domain, const std::string &key, int val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setOptBool %d\n", val);
|
//gprintf("setOptBool %d\n", val);
|
||||||
@ -289,7 +289,7 @@ void Config::setOptBool(const string &domain, const string &key, int val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setInt(const string &domain, const string &key, int val)
|
void Config::setInt(const std::string &domain, const std::string &key, int val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setInt %i\n", val);
|
//gprintf("setInt %i\n", val);
|
||||||
@ -305,7 +305,7 @@ void Config::setUInt(const std::string &domain, const std::string &key, unsigned
|
|||||||
m_domains[upperCase(domain)][lowerCase(key)] = sfmt("%u", val);
|
m_domains[upperCase(domain)][lowerCase(key)] = sfmt("%u", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setFloat(const string &domain, const string &key, float val)
|
void Config::setFloat(const std::string &domain, const std::string &key, float val)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return;
|
if (domain.empty() || key.empty()) return;
|
||||||
//gprintf("setFloat %f\n", val);
|
//gprintf("setFloat %f\n", val);
|
||||||
@ -329,10 +329,10 @@ void Config::setColor(const std::string &domain, const std::string &key, const C
|
|||||||
m_domains[upperCase(domain)][lowerCase(key)] = sfmt("#%.2X%.2X%.2X%.2X", val.r, val.g, val.b, val.a);
|
m_domains[upperCase(domain)][lowerCase(key)] = sfmt("#%.2X%.2X%.2X%.2X", val.r, val.g, val.b, val.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
wstringEx Config::getWString(const string &domain, const string &key, const wstringEx &defVal)
|
wstringEx Config::getWString(const std::string &domain, const std::string &key, const wstringEx &defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
data = defVal.toUTF8();
|
data = defVal.toUTF8();
|
||||||
@ -345,11 +345,11 @@ wstringEx Config::getWString(const string &domain, const string &key, const wstr
|
|||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Config::getString(const string &domain, const string &key, const string &defVal)
|
std::string Config::getString(const std::string &domain, const std::string &key, const std::string &defVal)
|
||||||
{
|
{
|
||||||
if(domain.empty() || key.empty())
|
if(domain.empty() || key.empty())
|
||||||
return defVal;
|
return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if(data.empty())
|
if(data.empty())
|
||||||
{
|
{
|
||||||
data = defVal;
|
data = defVal;
|
||||||
@ -359,13 +359,13 @@ string Config::getString(const string &domain, const string &key, const string &
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Config::getStringCustomTitles(const string &domain, const string &key, const string &defVal)
|
std::string Config::getStringCustomTitles(const std::string &domain, const std::string &key, const std::string &defVal)
|
||||||
{
|
{
|
||||||
if(domain.empty() || key.empty())
|
if(domain.empty() || key.empty())
|
||||||
return defVal;
|
return defVal;
|
||||||
KeyMap::iterator i = m_groupCustomTitles.find(upperCase(domain));
|
KeyMap::iterator i = m_groupCustomTitles.find(upperCase(domain));
|
||||||
if (i == m_groupCustomTitles.end()) return defVal;
|
if (i == m_groupCustomTitles.end()) return defVal;
|
||||||
string &data = m_domains[i->second][lowerCase(key)];
|
std::string &data = m_domains[i->second][lowerCase(key)];
|
||||||
if(data.empty())
|
if(data.empty())
|
||||||
{
|
{
|
||||||
data = defVal;
|
data = defVal;
|
||||||
@ -375,9 +375,9 @@ string Config::getStringCustomTitles(const string &domain, const string &key, co
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> Config::getStrings(const string &domain, const string &key, char seperator, const string &defVal)
|
std::vector<std::string> Config::getStrings(const std::string &domain, const std::string &key, char seperator, const std::string &defVal)
|
||||||
{
|
{
|
||||||
vector<string> retval;
|
std::vector<std::string> retval;
|
||||||
|
|
||||||
if(domain.empty() || key.empty())
|
if(domain.empty() || key.empty())
|
||||||
{
|
{
|
||||||
@ -386,7 +386,7 @@ vector<string> Config::getStrings(const string &domain, const string &key, char
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if(data.empty())
|
if(data.empty())
|
||||||
{
|
{
|
||||||
if(!defVal.empty())
|
if(!defVal.empty())
|
||||||
@ -396,19 +396,19 @@ vector<string> Config::getStrings(const string &domain, const string &key, char
|
|||||||
// Parse the string into different substrings
|
// Parse the string into different substrings
|
||||||
|
|
||||||
// skip delimiters at beginning.
|
// skip delimiters at beginning.
|
||||||
string::size_type lastPos = data.find_first_not_of(seperator, 0);
|
std::string::size_type lastPos = data.find_first_not_of(seperator, 0);
|
||||||
|
|
||||||
// find first "non-delimiter".
|
// find first "non-delimiter".
|
||||||
string::size_type pos = data.find_first_of(seperator, lastPos);
|
std::string::size_type pos = data.find_first_of(seperator, lastPos);
|
||||||
|
|
||||||
// no seperator found, return data
|
// no seperator found, return data
|
||||||
if(pos == string::npos)
|
if(pos == std::string::npos)
|
||||||
{
|
{
|
||||||
retval.push_back(data);
|
retval.push_back(data);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(string::npos != pos || string::npos != lastPos)
|
while(std::string::npos != pos || std::string::npos != lastPos)
|
||||||
{
|
{
|
||||||
// found a token, add it to the vector.
|
// found a token, add it to the vector.
|
||||||
retval.push_back(data.substr(lastPos, pos - lastPos));
|
retval.push_back(data.substr(lastPos, pos - lastPos));
|
||||||
@ -423,10 +423,10 @@ vector<string> Config::getStrings(const string &domain, const string &key, char
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::getBool(const string &domain, const string &key, bool defVal)
|
bool Config::getBool(const std::string &domain, const std::string &key, bool defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
data = defVal ? "yes" : "no";
|
data = defVal ? "yes" : "no";
|
||||||
@ -434,19 +434,19 @@ bool Config::getBool(const string &domain, const string &key, bool defVal)
|
|||||||
m_changed = true;
|
m_changed = true;
|
||||||
return defVal;
|
return defVal;
|
||||||
}
|
}
|
||||||
string s(lowerCase(trim(data)));
|
std::string s(lowerCase(trim(data)));
|
||||||
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::testOptBool(const string &domain, const string &key, bool defVal)
|
bool Config::testOptBool(const std::string &domain, const std::string &key, bool defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
KeyMap &km = m_domains[upperCase(domain)];
|
KeyMap &km = m_domains[upperCase(domain)];
|
||||||
KeyMap::iterator i = km.find(lowerCase(key));
|
KeyMap::iterator i = km.find(lowerCase(key));
|
||||||
if (i == km.end()) return defVal;
|
if (i == km.end()) return defVal;
|
||||||
string s(lowerCase(trim(i->second)));
|
std::string s(lowerCase(trim(i->second)));
|
||||||
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
||||||
return true;
|
return true;
|
||||||
if (s == "no" || s == "false" || s == "n" || s == "0")
|
if (s == "no" || s == "false" || s == "n" || s == "0")
|
||||||
@ -454,10 +454,10 @@ bool Config::testOptBool(const string &domain, const string &key, bool defVal)
|
|||||||
return defVal;
|
return defVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Config::getOptBool(const string &domain, const string &key, int defVal)
|
int Config::getOptBool(const std::string &domain, const std::string &key, int defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
switch (defVal)
|
switch (defVal)
|
||||||
@ -475,7 +475,7 @@ int Config::getOptBool(const string &domain, const string &key, int defVal)
|
|||||||
m_changed = true;
|
m_changed = true;
|
||||||
return defVal;
|
return defVal;
|
||||||
}
|
}
|
||||||
string s(lowerCase(trim(data)));
|
std::string s(lowerCase(trim(data)));
|
||||||
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
if (s == "yes" || s == "true" || s == "y" || s == "1")
|
||||||
return 1;
|
return 1;
|
||||||
if (s == "no" || s == "false" || s == "n" || s == "0")
|
if (s == "no" || s == "false" || s == "n" || s == "0")
|
||||||
@ -483,10 +483,10 @@ int Config::getOptBool(const string &domain, const string &key, int defVal)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Config::getInt(const string &domain, const string &key, int defVal)
|
int Config::getInt(const std::string &domain, const std::string &key, int defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
data = sfmt("%i", defVal);
|
data = sfmt("%i", defVal);
|
||||||
@ -501,16 +501,16 @@ int Config::getInt(const string &domain, const string &key, int defVal)
|
|||||||
bool Config::getInt(const std::string &domain, const std::string &key, int *value)
|
bool Config::getInt(const std::string &domain, const std::string &key, int *value)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return false;
|
if (domain.empty() || key.empty()) return false;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty()) return false;
|
if (data.empty()) return false;
|
||||||
*value = strtol(data.c_str(), 0, 10);
|
*value = strtol(data.c_str(), 0, 10);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Config::getUInt(const string &domain, const string &key, unsigned int defVal)
|
unsigned int Config::getUInt(const std::string &domain, const std::string &key, unsigned int defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
data = sfmt("%u", defVal);
|
data = sfmt("%u", defVal);
|
||||||
@ -521,10 +521,10 @@ unsigned int Config::getUInt(const string &domain, const string &key, unsigned i
|
|||||||
return strtoul(data.c_str(), 0, 10);
|
return strtoul(data.c_str(), 0, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Config::getFloat(const string &domain, const string &key, float defVal)
|
float Config::getFloat(const std::string &domain, const std::string &key, float defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
if (data.empty())
|
if (data.empty())
|
||||||
{
|
{
|
||||||
data = sfmt("%.*g", g_floatPrecision, defVal);
|
data = sfmt("%.*g", g_floatPrecision, defVal);
|
||||||
@ -538,12 +538,12 @@ float Config::getFloat(const string &domain, const string &key, float defVal)
|
|||||||
Vector3D Config::getVector3D(const std::string &domain, const std::string &key, const Vector3D &defVal)
|
Vector3D Config::getVector3D(const std::string &domain, const std::string &key, const Vector3D &defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
string::size_type i;
|
std::string::size_type i;
|
||||||
string::size_type j = string::npos;
|
std::string::size_type j = std::string::npos;
|
||||||
i = data.find_first_of(',');
|
i = data.find_first_of(',');
|
||||||
if (i != string::npos) j = data.find_first_of(',', i + 1);
|
if (i != std::string::npos) j = data.find_first_of(',', i + 1);
|
||||||
if (j == string::npos)
|
if (j == std::string::npos)
|
||||||
{
|
{
|
||||||
data = sfmt("%.*g, %.*g, %.*g", g_floatPrecision, defVal.x, g_floatPrecision, defVal.y, g_floatPrecision, defVal.z);
|
data = sfmt("%.*g, %.*g, %.*g", g_floatPrecision, defVal.x, g_floatPrecision, defVal.y, g_floatPrecision, defVal.z);
|
||||||
//gprintf("getVector3D\n");
|
//gprintf("getVector3D\n");
|
||||||
@ -556,16 +556,16 @@ Vector3D Config::getVector3D(const std::string &domain, const std::string &key,
|
|||||||
CColor Config::getColor(const std::string &domain, const std::string &key, const CColor &defVal)
|
CColor Config::getColor(const std::string &domain, const std::string &key, const CColor &defVal)
|
||||||
{
|
{
|
||||||
if (domain.empty() || key.empty()) return defVal;
|
if (domain.empty() || key.empty()) return defVal;
|
||||||
string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
std::string &data = m_domains[upperCase(domain)][lowerCase(key)];
|
||||||
string text(upperCase(trim(data)));
|
std::string text(upperCase(trim(data)));
|
||||||
u32 i = (u32)text.find_first_of('#');
|
u32 i = (u32)text.find_first_of('#');
|
||||||
if (i != string::npos)
|
if (i != std::string::npos)
|
||||||
{
|
{
|
||||||
text.erase(0, i + 1);
|
text.erase(0, i + 1);
|
||||||
i = (u32)text.find_first_not_of("0123456789ABCDEF");
|
i = (u32)text.find_first_not_of("0123456789ABCDEF");
|
||||||
if ((i != string::npos && i >= 6) || (i == string::npos && text.size() >= 6))
|
if ((i != std::string::npos && i >= 6) || (i == std::string::npos && text.size() >= 6))
|
||||||
{
|
{
|
||||||
u32 n = ((i != string::npos && i >= 8) || (i == string::npos && text.size() >= 8)) ? 8 : 6;
|
u32 n = ((i != std::string::npos && i >= 8) || (i == std::string::npos && text.size() >= 8)) ? 8 : 6;
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
if (text[i] <= '9')
|
if (text[i] <= '9')
|
||||||
text[i] -= '0';
|
text[i] -= '0';
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
wstringEx getWString(const std::string &domain, const std::string &key, const wstringEx &defVal = wstringEx());
|
wstringEx getWString(const std::string &domain, const std::string &key, const wstringEx &defVal = wstringEx());
|
||||||
std::string getString(const std::string &domain, const std::string &key, const std::string &defVal = std::string());
|
std::string getString(const std::string &domain, const std::string &key, const std::string &defVal = std::string());
|
||||||
std::string getStringCustomTitles(const std::string &domain, const std::string &key, const std::string &defVal = std::string());
|
std::string getStringCustomTitles(const std::string &domain, const std::string &key, const std::string &defVal = std::string());
|
||||||
vector<std::string> getStrings(const std::string &domain, const std::string &key, char seperator = ',', const std::string &defval = std::string());
|
std::vector<std::string> getStrings(const std::string &domain, const std::string &key, char seperator = ',', const std::string &defval = std::string());
|
||||||
bool getBool(const std::string &domain, const std::string &key, bool defVal = false);
|
bool getBool(const std::string &domain, const std::string &key, bool defVal = false);
|
||||||
int getOptBool(const std::string &domain, const std::string &key, int defVal = 2);
|
int getOptBool(const std::string &domain, const std::string &key, int defVal = 2);
|
||||||
bool testOptBool(const std::string &domain, const std::string &key, bool defVal);
|
bool testOptBool(const std::string &domain, const std::string &key, bool defVal);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#define APP_NAME "WiiFlow WFL"
|
#define APP_NAME "WiiFlow WFL"
|
||||||
#define APP_VERSION "5.5.0 beta 1"
|
#define APP_VERSION "5.5.0 beta 2"
|
||||||
|
|
||||||
#define APP_DATA_DIR "wiiflow"
|
#define APP_DATA_DIR "wiiflow"
|
||||||
#define APPS_DIR "apps/wiiflow"
|
#define APPS_DIR "apps/wiiflow"
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define MAX_PARTITIONS 32 /* Maximum number of partitions that can be found */
|
#define MAX_PARTITIONS 32 /* Maximum number of partitions that can be found */
|
||||||
#define MAX_MOUNTS 10 /* Maximum number of mounts available at one time */
|
#define MAX_MOUNTS 10 /* Maximum number of mounts available at one time */
|
||||||
#define MAX_SYMLINK_DEPTH 10 /* Maximum search depth when resolving symbolic links */
|
#define MAX_SYMLINK_DEPTH 10 /* Maximum search depth when resolving symbolic links */
|
||||||
@ -171,8 +169,8 @@ protected:
|
|||||||
s8 CheckGPT();
|
s8 CheckGPT();
|
||||||
|
|
||||||
const DISC_INTERFACE *interface;
|
const DISC_INTERFACE *interface;
|
||||||
vector<PartitionFS> PartitionList;
|
std::vector<PartitionFS> PartitionList;
|
||||||
vector<string> MountNameList;
|
std::vector<std::string> MountNameList;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#include "FreeTypeGX.h"
|
#include "FreeTypeGX.h"
|
||||||
#include "memory/mem2.hpp"
|
#include "memory/mem2.hpp"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define ALIGN8(x) (((x) + 7) & ~7)
|
#define ALIGN8(x) (((x) + 7) & ~7)
|
||||||
|
|
||||||
FreeTypeGX::FreeTypeGX()
|
FreeTypeGX::FreeTypeGX()
|
||||||
@ -88,8 +86,8 @@ void FreeTypeGX::unloadFont()
|
|||||||
{
|
{
|
||||||
if (this->fontData.size() == 0) return;
|
if (this->fontData.size() == 0) return;
|
||||||
|
|
||||||
map<int16_t, map<wchar_t, ftgxCharData> >::iterator itr;
|
std::map<int16_t, std::map<wchar_t, ftgxCharData> >::iterator itr;
|
||||||
map<wchar_t, ftgxCharData>::iterator itr2;
|
std::map<wchar_t, ftgxCharData>::iterator itr2;
|
||||||
|
|
||||||
for (itr = fontData.begin(); itr != fontData.end(); itr++)
|
for (itr = fontData.begin(); itr != fontData.end(); itr++)
|
||||||
{
|
{
|
||||||
@ -105,10 +103,10 @@ void FreeTypeGX::unloadFont()
|
|||||||
|
|
||||||
ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
||||||
{
|
{
|
||||||
map<int16_t, map<wchar_t, ftgxCharData> >::iterator itr = fontData.find(pixelSize);
|
std::map<int16_t, std::map<wchar_t, ftgxCharData> >::iterator itr = fontData.find(pixelSize);
|
||||||
if (itr != fontData.end())
|
if (itr != fontData.end())
|
||||||
{
|
{
|
||||||
map<wchar_t, ftgxCharData>::iterator itr2 = itr->second.find(charCode);
|
std::map<wchar_t, ftgxCharData>::iterator itr2 = itr->second.find(charCode);
|
||||||
if (itr2 != itr->second.end())
|
if (itr2 != itr->second.end())
|
||||||
{
|
{
|
||||||
return &itr2->second;
|
return &itr2->second;
|
||||||
@ -124,7 +122,7 @@ ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
|||||||
FT_Set_Pixel_Sizes(ftFace, 0, ftPointSize);
|
FT_Set_Pixel_Sizes(ftFace, 0, ftPointSize);
|
||||||
|
|
||||||
//!Cache ascender and decender as well
|
//!Cache ascender and decender as well
|
||||||
map<int16_t, ftgxDataOffset>::iterator itrAlign = ftgxAlign.find(ftPointSize);
|
std::map<int16_t, ftgxDataOffset>::iterator itrAlign = ftgxAlign.find(ftPointSize);
|
||||||
if (itrAlign == ftgxAlign.end())
|
if (itrAlign == ftgxAlign.end())
|
||||||
{
|
{
|
||||||
ftgxAlign[ftPointSize].ascender = (int16_t) ftFace->size->metrics.ascender >> 6;
|
ftgxAlign[ftPointSize].ascender = (int16_t) ftFace->size->metrics.ascender >> 6;
|
||||||
@ -231,7 +229,7 @@ int16_t FreeTypeGX::getStyleOffsetWidth(uint16_t width, uint16_t format)
|
|||||||
|
|
||||||
int16_t FreeTypeGX::getStyleOffsetHeight(int16_t format, uint16_t pixelSize)
|
int16_t FreeTypeGX::getStyleOffsetHeight(int16_t format, uint16_t pixelSize)
|
||||||
{
|
{
|
||||||
map<int16_t, ftgxDataOffset>::iterator itrAlign = ftgxAlign.find(pixelSize);
|
std::map<int16_t, ftgxDataOffset>::iterator itrAlign = ftgxAlign.find(pixelSize);
|
||||||
if (itrAlign == ftgxAlign.end()) return 0;
|
if (itrAlign == ftgxAlign.end()) return 0;
|
||||||
|
|
||||||
switch (format & FTGX_ALIGN_MASK)
|
switch (format & FTGX_ALIGN_MASK)
|
||||||
|
@ -80,8 +80,8 @@ bool GameTDB::OpenFile(const char *filepath)
|
|||||||
if(file)
|
if(file)
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
string OffsetsPath = filepath;
|
std::string OffsetsPath = filepath;
|
||||||
if((pos = OffsetsPath.find_last_of('/')) != (int) string::npos)
|
if((pos = OffsetsPath.find_last_of('/')) != (int) std::string::npos)
|
||||||
OffsetsPath[pos] = '\0';
|
OffsetsPath[pos] = '\0';
|
||||||
else
|
else
|
||||||
OffsetsPath.clear(); //! Relative path
|
OffsetsPath.clear(); //! Relative path
|
||||||
@ -96,7 +96,7 @@ bool GameTDB::OpenFile(const char *filepath)
|
|||||||
void GameTDB::CloseFile()
|
void GameTDB::CloseFile()
|
||||||
{
|
{
|
||||||
OffsetMap.clear();
|
OffsetMap.clear();
|
||||||
vector<GameOffsets>().swap(OffsetMap);
|
std::vector<GameOffsets>().swap(OffsetMap);
|
||||||
|
|
||||||
if(GameNodeCache)
|
if(GameNodeCache)
|
||||||
MEM2_free(GameNodeCache);
|
MEM2_free(GameNodeCache);
|
||||||
@ -112,7 +112,7 @@ bool GameTDB::LoadGameOffsets(const char *path)
|
|||||||
if(!path)
|
if(!path)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string OffsetDBPath = path;
|
std::string OffsetDBPath = path;
|
||||||
if(strlen(path) > 0 && path[strlen(path)-1] != '/')
|
if(strlen(path) > 0 && path[strlen(path)-1] != '/')
|
||||||
OffsetDBPath += '/';
|
OffsetDBPath += '/';
|
||||||
OffsetDBPath += NAME_OFFSET_DB;
|
OffsetDBPath += NAME_OFFSET_DB;
|
||||||
@ -777,7 +777,7 @@ bool GameTDB::GetRatingValue(const char *id, const char * &rating_value)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameTDB::GetRatingDescriptors(const char *id, vector<string> & desc_list)
|
int GameTDB::GetRatingDescriptors(const char *id, std::vector<std::string> & desc_list)
|
||||||
{
|
{
|
||||||
desc_list.clear();
|
desc_list.clear();
|
||||||
if(!id)
|
if(!id)
|
||||||
@ -845,7 +845,7 @@ int GameTDB::GetWifiPlayers(const char *id)
|
|||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameTDB::GetWifiFeatures(const char *id, vector<string> & feat_list)
|
int GameTDB::GetWifiFeatures(const char *id, std::vector<std::string> & feat_list)
|
||||||
{
|
{
|
||||||
feat_list.clear();
|
feat_list.clear();
|
||||||
if(!id)
|
if(!id)
|
||||||
@ -917,7 +917,7 @@ int GameTDB::GetPlayers(const char *id)
|
|||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GameTDB::GetAccessories(const char *id, vector<Accessory> & acc_list)
|
int GameTDB::GetAccessories(const char *id, std::vector<Accessory> & acc_list)
|
||||||
{
|
{
|
||||||
acc_list.clear();
|
acc_list.clear();
|
||||||
if(!id)
|
if(!id)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <gccore.h>
|
#include <gccore.h>
|
||||||
|
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -40,7 +40,7 @@ enum
|
|||||||
|
|
||||||
typedef struct _Accessory
|
typedef struct _Accessory
|
||||||
{
|
{
|
||||||
string Name;
|
std::string Name;
|
||||||
bool Required;
|
bool Required;
|
||||||
} Accessory;
|
} Accessory;
|
||||||
|
|
||||||
@ -95,19 +95,19 @@ public:
|
|||||||
bool GetRatingValue(const char * id, const char * &rating_value);
|
bool GetRatingValue(const char * id, const char * &rating_value);
|
||||||
//! Get the rating descriptor list inside a vector for a specific game id
|
//! Get the rating descriptor list inside a vector for a specific game id
|
||||||
//! Returns the amount of descriptors found or -1 if failed
|
//! Returns the amount of descriptors found or -1 if failed
|
||||||
int GetRatingDescriptors(const char * id, vector<string> & desc_list);
|
int GetRatingDescriptors(const char * id, std::vector<std::string> & desc_list);
|
||||||
//! Get the wifi player count for a specific game id
|
//! Get the wifi player count for a specific game id
|
||||||
//! Returns the amount of wifi players or -1 if failed
|
//! Returns the amount of wifi players or -1 if failed
|
||||||
int GetWifiPlayers(const char * id);
|
int GetWifiPlayers(const char * id);
|
||||||
//! Get the wifi feature list inside a vector for a specific game id
|
//! Get the wifi feature list inside a vector for a specific game id
|
||||||
//! Returns the amount of wifi features found or -1 if failed
|
//! Returns the amount of wifi features found or -1 if failed
|
||||||
int GetWifiFeatures(const char * id, vector<string> & feat_list);
|
int GetWifiFeatures(const char * id, std::vector<std::string> & feat_list);
|
||||||
//! Get the player count for a specific game id
|
//! Get the player count for a specific game id
|
||||||
//! Returns the amount of players or -1 if failed
|
//! Returns the amount of players or -1 if failed
|
||||||
int GetPlayers(const char * id);
|
int GetPlayers(const char * id);
|
||||||
//! Returns the amount of accessoires found or -1 if failed
|
//! Returns the amount of accessoires found or -1 if failed
|
||||||
//! Get the accessoire (inputs) list inside a vector for a specific game id
|
//! Get the accessoire (inputs) list inside a vector for a specific game id
|
||||||
int GetAccessories(const char * id, vector<Accessory> & acc_list);
|
int GetAccessories(const char * id, std::vector<Accessory> & acc_list);
|
||||||
//! Get the box (case) color for a specific game id
|
//! Get the box (case) color for a specific game id
|
||||||
//! Returns the color in RGB (first 3 bytes)
|
//! Returns the color in RGB (first 3 bytes)
|
||||||
u32 GetCaseColor(const char * id);
|
u32 GetCaseColor(const char * id);
|
||||||
@ -132,9 +132,9 @@ private:
|
|||||||
inline char * GetNodeText(char *data, const char *nodestart, const char *nodeend);
|
inline char * GetNodeText(char *data, const char *nodestart, const char *nodeend);
|
||||||
|
|
||||||
bool isLoaded;
|
bool isLoaded;
|
||||||
vector<GameOffsets> OffsetMap;
|
std::vector<GameOffsets> OffsetMap;
|
||||||
FILE * file;
|
FILE * file;
|
||||||
string LangCode;
|
std::string LangCode;
|
||||||
char *GameNodeCache;
|
char *GameNodeCache;
|
||||||
char GameIDCache[7];
|
char GameIDCache[7];
|
||||||
};
|
};
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "texture.hpp"
|
#include "texture.hpp"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class WiiMovie
|
class WiiMovie
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
#include "loader/utils.h"
|
#include "loader/utils.h"
|
||||||
#include "music/gui_sound.h"
|
#include "music/gui_sound.h"
|
||||||
|
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
|
using std::min;
|
||||||
|
using std::max;
|
||||||
|
|
||||||
enum Sorting
|
enum Sorting
|
||||||
{
|
{
|
||||||
@ -47,7 +49,7 @@ public:
|
|||||||
bool empty(void) const { return m_items.empty(); }
|
bool empty(void) const { return m_items.empty(); }
|
||||||
u32 size(void) const { return m_items.size(); }
|
u32 size(void) const { return m_items.size(); }
|
||||||
//
|
//
|
||||||
bool start(const string &m_imgsDir);
|
bool start(const std::string &m_imgsDir);
|
||||||
void stopCoverLoader(bool empty = false);
|
void stopCoverLoader(bool empty = false);
|
||||||
void startCoverLoader(void);
|
void startCoverLoader(void);
|
||||||
u32 _currentPos(void) const;
|
u32 _currentPos(void) const;
|
||||||
@ -86,7 +88,7 @@ public:
|
|||||||
void setCompression(bool enable) { m_compressTextures = enable; }
|
void setCompression(bool enable) { m_compressTextures = enable; }
|
||||||
bool getBoxMode(void) const { return m_box;}
|
bool getBoxMode(void) const { return m_box;}
|
||||||
void setBufferSize(u32 numCovers);
|
void setBufferSize(u32 numCovers);
|
||||||
void setTextures(const string &loadingPic, const string &loadingPicFlat, const string &noCoverPic, const string &noCoverPicFlat);
|
void setTextures(const std::string &loadingPic, const std::string &loadingPicFlat, const std::string &noCoverPic, const std::string &noCoverPicFlat);
|
||||||
void setFont(const SFont &font, const CColor &color);
|
void setFont(const SFont &font, const CColor &color);
|
||||||
void setRange(u32 rows, u32 columns);
|
void setRange(u32 rows, u32 columns);
|
||||||
void setBoxMode(bool box);
|
void setBoxMode(bool box);
|
||||||
@ -237,7 +239,7 @@ private:
|
|||||||
Vector3D m_cameraAim;
|
Vector3D m_cameraAim;
|
||||||
Vector3D m_targetCameraPos;
|
Vector3D m_targetCameraPos;
|
||||||
Vector3D m_targetCameraAim;
|
Vector3D m_targetCameraAim;
|
||||||
vector<CItem> m_items;
|
std::vector<CItem> m_items;
|
||||||
CCover *m_covers;
|
CCover *m_covers;
|
||||||
int m_delay;
|
int m_delay;
|
||||||
int m_minDelay;
|
int m_minDelay;
|
||||||
@ -264,10 +266,10 @@ private:
|
|||||||
TexData m_dvdSkin_GreenTwo;
|
TexData m_dvdSkin_GreenTwo;
|
||||||
TexData m_dvdSkin_Clear;
|
TexData m_dvdSkin_Clear;
|
||||||
// Settings
|
// Settings
|
||||||
string m_pngLoadCover;
|
std::string m_pngLoadCover;
|
||||||
string m_pngLoadCoverFlat;
|
std::string m_pngLoadCoverFlat;
|
||||||
string m_pngNoCover;
|
std::string m_pngNoCover;
|
||||||
string m_pngNoCoverFlat;
|
std::string m_pngNoCoverFlat;
|
||||||
u32 m_numBufCovers;
|
u32 m_numBufCovers;
|
||||||
SFont m_font;
|
SFont m_font;
|
||||||
CColor m_fontColor;
|
CColor m_fontColor;
|
||||||
@ -285,7 +287,7 @@ private:
|
|||||||
bool m_hideCover;
|
bool m_hideCover;
|
||||||
bool m_compressTextures;
|
bool m_compressTextures;
|
||||||
bool m_compressCache;
|
bool m_compressCache;
|
||||||
string m_cachePath;
|
std::string m_cachePath;
|
||||||
bool m_deletePicsAfterCaching;
|
bool m_deletePicsAfterCaching;
|
||||||
bool m_pluginCacheFolders;
|
bool m_pluginCacheFolders;
|
||||||
bool m_mirrorBlur;
|
bool m_mirrorBlur;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "memory/mem2.hpp"
|
#include "memory/mem2.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
|
|
||||||
extern const u8 player1_point_png[];
|
extern const u8 player1_point_png[];
|
||||||
extern const u8 player2_point_png[];
|
extern const u8 player2_point_png[];
|
||||||
@ -172,13 +172,13 @@ void CCursor::_blur(void)
|
|||||||
return;
|
return;
|
||||||
for (int i = 0; i < w; ++i)
|
for (int i = 0; i < w; ++i)
|
||||||
{
|
{
|
||||||
xmax[i] = min(i + radius + 1, w - 1);
|
xmax[i] = std::min(i + radius + 1, w - 1);
|
||||||
xmin[i] = max(i - radius, 0);
|
xmin[i] = std::max(i - radius, 0);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < h; ++i)
|
for (int i = 0; i < h; ++i)
|
||||||
{
|
{
|
||||||
ymax[i] = min(i + radius + 1, h - 1) * w;
|
ymax[i] = std::min(i + radius + 1, h - 1) * w;
|
||||||
ymin[i] = max(i - radius, 0) * w;
|
ymin[i] = std::max(i - radius, 0) * w;
|
||||||
}
|
}
|
||||||
for (int k = 0; k < pass; ++k) // 2 passes for much better quality
|
for (int k = 0; k < pass; ++k) // 2 passes for much better quality
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ void CCursor::_blur(void)
|
|||||||
{
|
{
|
||||||
sum = 0;
|
sum = 0;
|
||||||
for (int i = -radius; i <= radius; ++i)
|
for (int i = -radius; i <= radius; ++i)
|
||||||
sum += pic[coordsI8(min(max(0, i), w - 1), y, w)];
|
sum += pic[coordsI8(std::min(std::max(0, i), w - 1), y, w)];
|
||||||
for (int x = 0; x < w; ++x)
|
for (int x = 0; x < w; ++x)
|
||||||
{
|
{
|
||||||
r[yi] = sum / div;
|
r[yi] = sum / div;
|
||||||
@ -202,7 +202,7 @@ void CCursor::_blur(void)
|
|||||||
yp = -radius * w;
|
yp = -radius * w;
|
||||||
for (int i = -radius; i <= radius; ++i)
|
for (int i = -radius; i <= radius; ++i)
|
||||||
{
|
{
|
||||||
yi = max(0, yp) + x;
|
yi = std::max(0, yp) + x;
|
||||||
sum += r[yi];
|
sum += r[yi];
|
||||||
yp += w;
|
yp += w;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "memory/mem2.hpp"
|
#include "memory/mem2.hpp"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
|
|
||||||
static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!!
|
static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!!
|
||||||
static guVector _GRRaxisy = (guVector){0, 1, 0}; // Even at runtime
|
static guVector _GRRaxisy = (guVector){0, 1, 0}; // Even at runtime
|
||||||
@ -22,7 +22,7 @@ void CFanart::unload()
|
|||||||
{
|
{
|
||||||
m_faConfig.unload();
|
m_faConfig.unload();
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
for(vector<CFanartElement>::iterator Elm = m_elms.begin(); Elm != m_elms.end(); Elm++)
|
for(std::vector<CFanartElement>::iterator Elm = m_elms.begin(); Elm != m_elms.end(); Elm++)
|
||||||
Elm->Cleanup();
|
Elm->Cleanup();
|
||||||
m_elms.clear();
|
m_elms.clear();
|
||||||
TexHandle.Cleanup(m_bg);
|
TexHandle.Cleanup(m_bg);
|
||||||
@ -105,7 +105,7 @@ void CFanart::getBackground(const TexData * &hq, const TexData * &lq)
|
|||||||
|
|
||||||
void CFanart::reset()
|
void CFanart::reset()
|
||||||
{
|
{
|
||||||
for(vector<CFanartElement>::iterator Elm = m_elms.begin(); Elm != m_elms.end(); Elm++)
|
for(std::vector<CFanartElement>::iterator Elm = m_elms.begin(); Elm != m_elms.end(); Elm++)
|
||||||
Elm->Cleanup();
|
Elm->Cleanup();
|
||||||
m_elms.clear();
|
m_elms.clear();
|
||||||
for(int i = 1; i <= 6; i++)
|
for(int i = 1; i <= 6; i++)
|
||||||
@ -186,7 +186,7 @@ CFanartElement::CFanartElement(Config &cfg, const char *dir, int artwork)
|
|||||||
m_y = cfg.getInt(domain, "y", 0);
|
m_y = cfg.getInt(domain, "y", 0);
|
||||||
m_scaleX = cfg.getFloat(domain, "scale_x", 1.f);
|
m_scaleX = cfg.getFloat(domain, "scale_x", 1.f);
|
||||||
m_scaleY = cfg.getFloat(domain, "scale_y", 1.f);
|
m_scaleY = cfg.getFloat(domain, "scale_y", 1.f);
|
||||||
m_alpha = min(cfg.getInt(domain, "alpha", 255), 255);
|
m_alpha = std::min(cfg.getInt(domain, "alpha", 255), 255);
|
||||||
m_delay = (int) (cfg.getFloat(domain, "delay", 0.f) * 50);
|
m_delay = (int) (cfg.getFloat(domain, "delay", 0.f) * 50);
|
||||||
m_angle = cfg.getFloat(domain, "angle", 0.f);
|
m_angle = cfg.getFloat(domain, "angle", 0.f);
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ CFanartElement::CFanartElement(Config &cfg, const char *dir, int artwork)
|
|||||||
m_event_y = m_event_duration == 0 ? m_y : cfg.getInt(domain, "event_y", m_y);
|
m_event_y = m_event_duration == 0 ? m_y : cfg.getInt(domain, "event_y", m_y);
|
||||||
m_event_scaleX = m_event_duration == 0 ? m_scaleX : cfg.getInt(domain, "event_scale_x", m_scaleX);
|
m_event_scaleX = m_event_duration == 0 ? m_scaleX : cfg.getInt(domain, "event_scale_x", m_scaleX);
|
||||||
m_event_scaleY = m_event_duration == 0 ? m_scaleY : cfg.getInt(domain, "event_scale_y", m_scaleY);
|
m_event_scaleY = m_event_duration == 0 ? m_scaleY : cfg.getInt(domain, "event_scale_y", m_scaleY);
|
||||||
m_event_alpha = m_event_duration == 0 ? m_alpha : min(cfg.getInt(domain, "event_alpha", m_alpha), 255); // Not from m_alpha, because the animation can start less translucent than m_alpha
|
m_event_alpha = m_event_duration == 0 ? m_alpha : std::min(cfg.getInt(domain, "event_alpha", m_alpha), 255); // Not from m_alpha, because the animation can start less translucent than m_alpha
|
||||||
m_event_angle = m_event_duration == 0 ? m_angle : cfg.getFloat(domain, "event_angle", m_angle);
|
m_event_angle = m_event_duration == 0 ? m_angle : cfg.getFloat(domain, "event_angle", m_angle);
|
||||||
|
|
||||||
m_step_x = m_event_duration == 0 ? 0 : (m_x - m_event_x) / m_event_duration;
|
m_step_x = m_event_duration == 0 ? 0 : (m_x - m_event_x) / m_event_duration;
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<CFanartElement> m_elms;
|
std::vector<CFanartElement> m_elms;
|
||||||
|
|
||||||
bool m_animationComplete;
|
bool m_animationComplete;
|
||||||
u16 m_delayAfterAnimation;
|
u16 m_delayAfterAnimation;
|
||||||
|
@ -36,8 +36,6 @@
|
|||||||
#include "loader/utils.h"
|
#include "loader/utils.h"
|
||||||
#include "memory/mem2.hpp"
|
#include "memory/mem2.hpp"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
void readThpHeader(FILE* f, ThpHeader& h)
|
void readThpHeader(FILE* f, ThpHeader& h)
|
||||||
{
|
{
|
||||||
fread(&h, sizeof(h), 1, f);
|
fread(&h, sizeof(h), 1, f);
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
#include <stdio.h> //FILE*
|
#include <stdio.h> //FILE*
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
#include <gccore.h>
|
#include <gccore.h>
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#include "gui.hpp"
|
#include "gui.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
template <class T> static inline T loopNum(T i, T s)
|
template <class T> static inline T loopNum(T i, T s)
|
||||||
{
|
{
|
||||||
return (i + s) % s;
|
return (i + s) % s;
|
||||||
@ -444,7 +442,7 @@ void CButtonsMgr::stopSounds(void)
|
|||||||
|
|
||||||
void CButtonsMgr::setSoundVolume(int vol)
|
void CButtonsMgr::setSoundVolume(int vol)
|
||||||
{
|
{
|
||||||
m_soundVolume = min(max(0, vol), 0xFF);
|
m_soundVolume = std::min(std::max(0, vol), 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CButtonsMgr::setRumble(int chan, bool wii, bool gc, bool wupc)
|
void CButtonsMgr::setRumble(int chan, bool wii, bool gc, bool wupc)
|
||||||
|
@ -168,9 +168,9 @@ bool SFont::fromBuffer(const u8 *buffer, const u32 bufferSize, u32 size, u32 lsp
|
|||||||
{
|
{
|
||||||
if(buffer == NULL)
|
if(buffer == NULL)
|
||||||
return false;
|
return false;
|
||||||
fSize = min(max(6u, size), 1000u);
|
fSize = std::min(std::max(6u, size), 1000u);
|
||||||
lineSpacing = min(max(6u, lspacing), 1000u);
|
lineSpacing = std::min(std::max(6u, lspacing), 1000u);
|
||||||
weight = min(w, 32u);
|
weight = std::min(w, 32u);
|
||||||
index = idx;// currently not used
|
index = idx;// currently not used
|
||||||
|
|
||||||
if(data != NULL)
|
if(data != NULL)
|
||||||
@ -190,11 +190,11 @@ bool SFont::fromBuffer(const u8 *buffer, const u32 bufferSize, u32 size, u32 lsp
|
|||||||
|
|
||||||
bool SFont::fromFile(const char *path, u32 size, u32 lspacing, u32 w, u32 idx, const char *fontname)
|
bool SFont::fromFile(const char *path, u32 size, u32 lspacing, u32 w, u32 idx, const char *fontname)
|
||||||
{
|
{
|
||||||
fSize = min(max(6u, size), 1000u);
|
fSize = std::min(std::max(6u, size), 1000u);
|
||||||
weight = min(w, 32u);
|
weight = std::min(w, 32u);
|
||||||
index = idx;// currently not used
|
index = idx;// currently not used
|
||||||
|
|
||||||
lineSpacing = min(max(6u, lspacing), 1000u);
|
lineSpacing = std::min(std::max(6u, lspacing), 1000u);
|
||||||
|
|
||||||
if(data != NULL)
|
if(data != NULL)
|
||||||
free(data);
|
free(data);
|
||||||
@ -425,14 +425,14 @@ string lowerCase(string text)
|
|||||||
// trim from start
|
// trim from start
|
||||||
string ltrim(string s)
|
string ltrim(string s)
|
||||||
{
|
{
|
||||||
s.erase(s.begin(), find_if(s.begin(), s.end(), not1(ptr_fun<int, int>(isspace))));
|
s.erase(s.begin(), find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(isspace))));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// trim from end
|
// trim from end
|
||||||
string rtrim(string s)
|
string rtrim(string s)
|
||||||
{
|
{
|
||||||
s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
|
s.erase(find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(isspace))).base(), s.end());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
#include "video.hpp"
|
#include "video.hpp"
|
||||||
#include "wstringEx/wstringEx.hpp"
|
#include "wstringEx/wstringEx.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class SFont// should be either struct SFont or class CFont
|
class SFont// should be either struct SFont or class CFont
|
||||||
{
|
{
|
||||||
@ -59,17 +60,17 @@ private:
|
|||||||
|
|
||||||
// Nothing to do with CText. Q&D helpers for string formating.
|
// Nothing to do with CText. Q&D helpers for string formating.
|
||||||
|
|
||||||
std::string sfmt(const char *format, ...);
|
string sfmt(const char *format, ...);
|
||||||
wstringEx wfmt(const wstringEx &format, ...);
|
wstringEx wfmt(const wstringEx &format, ...);
|
||||||
bool checkFmt(const wstringEx &ref, const wstringEx &format);
|
bool checkFmt(const wstringEx &ref, const wstringEx &format);
|
||||||
std::string vectorToString(const vector<std::string> &vect, std::string sep);
|
string vectorToString(const vector<string> &vect, string sep);
|
||||||
wstringEx vectorToString(const vector<wstringEx> &vect, char sep);
|
wstringEx vectorToString(const vector<wstringEx> &vect, char sep);
|
||||||
vector<wstringEx> stringToVector(const wstringEx &text, char sep);
|
vector<wstringEx> stringToVector(const wstringEx &text, char sep);
|
||||||
vector<std::string> stringToVector(const std::string &text, char sep);
|
vector<std::string> stringToVector(const string &text, char sep);
|
||||||
std::string upperCase(std::string text);
|
string upperCase(string text);
|
||||||
std::string lowerCase(std::string text);
|
string lowerCase(string text);
|
||||||
std::string ltrim(std::string s);
|
string ltrim(string s);
|
||||||
std::string rtrim(std::string s);
|
string rtrim(string s);
|
||||||
bool wchar_cmp(const wchar_t *first, const wchar_t *second, u32 first_len, u32 second_len);
|
bool wchar_cmp(const wchar_t *first, const wchar_t *second, u32 first_len, u32 second_len);
|
||||||
bool char_cmp(const char *first, const char *second, u32 first_len, u32 second_len);
|
bool char_cmp(const char *first, const char *second, u32 first_len, u32 second_len);
|
||||||
|
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include "pngu.h"
|
#include "pngu.h"
|
||||||
#include "gcvid.h"
|
#include "gcvid.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
STexture TexHandle;
|
STexture TexHandle;
|
||||||
|
|
||||||
static u32 upperPower(u32 width)
|
static u32 upperPower(u32 width)
|
||||||
@ -657,11 +655,11 @@ void STexture::_calcMipMaps(u8 &maxLOD, u8 &minLOD, u32 &lod0Width, u32 &lod0Hei
|
|||||||
if (height - (lod0Height >> 1) < lod0Height >> 3 && minSize <= lod0Height >> 1)
|
if (height - (lod0Height >> 1) < lod0Height >> 3 && minSize <= lod0Height >> 1)
|
||||||
lod0Height >>= 1;
|
lod0Height >>= 1;
|
||||||
maxLOD = 0;
|
maxLOD = 0;
|
||||||
for (u32 i = min(lod0Width, lod0Height); i > minSize; i >>= 1)
|
for (u32 i = std::min(lod0Width, lod0Height); i > minSize; i >>= 1)
|
||||||
++maxLOD;
|
++maxLOD;
|
||||||
minLOD = 0;
|
minLOD = 0;
|
||||||
if (maxSize > 8)
|
if (maxSize > 8)
|
||||||
for (u32 i = max(lod0Width, lod0Height); i > maxSize; i >>= 1)
|
for (u32 i = std::max(lod0Width, lod0Height); i > maxSize; i >>= 1)
|
||||||
++minLOD;
|
++minLOD;
|
||||||
if (minLOD > maxLOD)
|
if (minLOD > maxLOD)
|
||||||
maxLOD = minLOD;
|
maxLOD = minLOD;
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
#include <gccore.h>
|
#include <gccore.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
#include "vector.hpp"
|
#include "vector.hpp"
|
||||||
#include "texture.hpp"
|
#include "texture.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class CTexCoord
|
class CTexCoord
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,9 @@ u32 homebrew_size = 0;
|
|||||||
|
|
||||||
u8 *appbooter_ptr = NULL;
|
u8 *appbooter_ptr = NULL;
|
||||||
u32 appbooter_size = 0;
|
u32 appbooter_size = 0;
|
||||||
using namespace std;
|
|
||||||
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
extern const u8 wfstub_bin[];
|
extern const u8 wfstub_bin[];
|
||||||
extern const u32 wfstub_bin_size;
|
extern const u32 wfstub_bin_size;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* callbacks.h
|
/* callbacks.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
/* crl.h
|
/* crl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
#ifdef HAVE_CRL
|
#ifdef HAVE_CRL
|
||||||
|
|
||||||
#include <libwolfssl/ssl.h>
|
#include <libs/libwolfssl/ssl.h>
|
||||||
#include <libwolfssl/wolfcrypt/asn.h>
|
#include <libs/libwolfssl/wolfcrypt/asn.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* error-ssl.h
|
/* error-ssl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#ifndef WOLFSSL_ERROR_H
|
#ifndef WOLFSSL_ERROR_H
|
||||||
#define WOLFSSL_ERROR_H
|
#define WOLFSSL_ERROR_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/error-crypt.h> /* pull in wolfCrypt errors */
|
#include <libs/libwolfssl/wolfcrypt/error-crypt.h> /* pull in wolfCrypt errors */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -169,6 +169,10 @@ enum wolfSSL_ErrorCodes {
|
|||||||
TLS13_SECRET_CB_E = -438, /* TLS1.3 secret Cb fcn failure */
|
TLS13_SECRET_CB_E = -438, /* TLS1.3 secret Cb fcn failure */
|
||||||
DTLS_SIZE_ERROR = -439, /* Trying to send too much data */
|
DTLS_SIZE_ERROR = -439, /* Trying to send too much data */
|
||||||
NO_CERT_ERROR = -440, /* TLS1.3 - no cert set error */
|
NO_CERT_ERROR = -440, /* TLS1.3 - no cert set error */
|
||||||
|
APP_DATA_READY = -441, /* DTLS1.2 application data ready for read */
|
||||||
|
TOO_MUCH_EARLY_DATA = -442, /* Too much Early data */
|
||||||
|
|
||||||
|
SOCKET_FILTERED_E = -443, /* Session stopped by network filter */
|
||||||
|
|
||||||
/* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
|
/* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
/* ocsp.h
|
/* ocsp.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OCSP
|
#ifdef HAVE_OCSP
|
||||||
|
|
||||||
#include <libwolfssl/ssl.h>
|
#include <libs/libwolfssl/ssl.h>
|
||||||
#include <libwolfssl/wolfcrypt/asn.h>
|
#include <libs/libwolfssl/wolfcrypt/asn.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -38,10 +38,12 @@
|
|||||||
typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
|
typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
|
||||||
|
|
||||||
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_NGINX) ||\
|
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_NGINX) ||\
|
||||||
defined(WOLFSSL_HAPROXY)
|
defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)
|
||||||
typedef struct OcspResponse WOLFSSL_OCSP_BASICRESP;
|
typedef struct OcspResponse WOLFSSL_OCSP_BASICRESP;
|
||||||
|
|
||||||
typedef struct OcspRequest WOLFSSL_OCSP_CERTID;
|
typedef struct OcspEntry WOLFSSL_OCSP_CERTID;
|
||||||
|
|
||||||
|
typedef struct OcspEntry WOLFSSL_OCSP_SINGLERESP;
|
||||||
|
|
||||||
typedef struct OcspRequest WOLFSSL_OCSP_ONEREQ;
|
typedef struct OcspRequest WOLFSSL_OCSP_ONEREQ;
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ WOLFSSL_LOCAL int CheckOcspResponse(WOLFSSL_OCSP *ocsp, byte *response, int resp
|
|||||||
OcspEntry *entry, OcspRequest *ocspRequest);
|
OcspEntry *entry, OcspRequest *ocspRequest);
|
||||||
|
|
||||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
||||||
defined(WOLFSSL_APACHE_HTTPD)
|
defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIGHTY)
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
|
WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
|
||||||
WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
|
WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
|
||||||
@ -82,8 +84,10 @@ WOLFSSL_API int wolfSSL_OCSP_basic_verify(WOLFSSL_OCSP_BASICRESP *bs,
|
|||||||
WOLF_STACK_OF(WOLFSSL_X509) *certs, WOLFSSL_X509_STORE *st, unsigned long flags);
|
WOLF_STACK_OF(WOLFSSL_X509) *certs, WOLFSSL_X509_STORE *st, unsigned long flags);
|
||||||
|
|
||||||
WOLFSSL_API void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response);
|
WOLFSSL_API void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response);
|
||||||
|
#ifndef NO_BIO
|
||||||
WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE_bio(WOLFSSL_BIO* bio,
|
WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE_bio(WOLFSSL_BIO* bio,
|
||||||
OcspResponse** response);
|
OcspResponse** response);
|
||||||
|
#endif
|
||||||
WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE(OcspResponse** response,
|
WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE(OcspResponse** response,
|
||||||
const unsigned char** data, int len);
|
const unsigned char** data, int len);
|
||||||
WOLFSSL_API int wolfSSL_i2d_OCSP_RESPONSE(OcspResponse* response,
|
WOLFSSL_API int wolfSSL_i2d_OCSP_RESPONSE(OcspResponse* response,
|
||||||
@ -100,8 +104,21 @@ WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST(OcspRequest* request,
|
|||||||
WOLFSSL_API WOLFSSL_OCSP_ONEREQ* wolfSSL_OCSP_request_add0_id(OcspRequest *req,
|
WOLFSSL_API WOLFSSL_OCSP_ONEREQ* wolfSSL_OCSP_request_add0_id(OcspRequest *req,
|
||||||
WOLFSSL_OCSP_CERTID *cid);
|
WOLFSSL_OCSP_CERTID *cid);
|
||||||
WOLFSSL_API WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_CERTID_dup(WOLFSSL_OCSP_CERTID*);
|
WOLFSSL_API WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_CERTID_dup(WOLFSSL_OCSP_CERTID*);
|
||||||
|
#ifndef NO_BIO
|
||||||
WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST_bio(WOLFSSL_BIO* out,
|
WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST_bio(WOLFSSL_BIO* out,
|
||||||
WOLFSSL_OCSP_REQUEST *req);
|
WOLFSSL_OCSP_REQUEST *req);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_i2d_OCSP_CERTID(WOLFSSL_OCSP_CERTID *, unsigned char **);
|
||||||
|
WOLFSSL_API const WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_SINGLERESP_get0_id(const WOLFSSL_OCSP_SINGLERESP *single);
|
||||||
|
WOLFSSL_API int wolfSSL_OCSP_id_cmp(WOLFSSL_OCSP_CERTID *a, WOLFSSL_OCSP_CERTID *b);
|
||||||
|
WOLFSSL_API int wolfSSL_OCSP_single_get0_status(WOLFSSL_OCSP_SINGLERESP *single,
|
||||||
|
int *reason,
|
||||||
|
WOLFSSL_ASN1_TIME **revtime,
|
||||||
|
WOLFSSL_ASN1_TIME **thisupd,
|
||||||
|
WOLFSSL_ASN1_TIME **nextupd);
|
||||||
|
WOLFSSL_API int wolfSSL_OCSP_resp_count(WOLFSSL_OCSP_BASICRESP *bs);
|
||||||
|
WOLFSSL_API WOLFSSL_OCSP_SINGLERESP* wolfSSL_OCSP_resp_get0(WOLFSSL_OCSP_BASICRESP *bs, int idx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* aes.h
|
/* aes.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -29,10 +29,10 @@
|
|||||||
#ifndef WOLFSSL_AES_H_
|
#ifndef WOLFSSL_AES_H_
|
||||||
#define WOLFSSL_AES_H_
|
#define WOLFSSL_AES_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
#include <libwolfssl/openssl/ssl.h> /* for size_t */
|
#include <libs/libwolfssl/openssl/ssl.h> /* for size_t */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -42,26 +42,7 @@
|
|||||||
* OpenSSL compatibility layer. This makes code working with an AES structure
|
* OpenSSL compatibility layer. This makes code working with an AES structure
|
||||||
* to need the size of the structure. */
|
* to need the size of the structure. */
|
||||||
typedef struct WOLFSSL_AES_KEY {
|
typedef struct WOLFSSL_AES_KEY {
|
||||||
/* aligned and big enough for Aes from wolfssl/wolfcrypt/aes.h */
|
ALIGN16 void *buf[(sizeof(Aes) / sizeof(void *)) + 1];
|
||||||
ALIGN16 void* holder[(376 + WC_ASYNC_DEV_SIZE)/ sizeof(void*)];
|
|
||||||
#ifdef GCM_TABLE
|
|
||||||
/* key-based fast multiplication table. */
|
|
||||||
ALIGN16 void* M0[4096 / sizeof(void*)];
|
|
||||||
#endif /* GCM_TABLE */
|
|
||||||
#if defined(WOLFSSL_DEVCRYPTO) && \
|
|
||||||
(defined(WOLFSSL_DEVCRYPTO_AES) || defined(WOLFSSL_DEVCRYPTO_CBC))
|
|
||||||
/* large enough for additional devcrypto information */
|
|
||||||
void* devKey[288 / sizeof(void*)];
|
|
||||||
#endif
|
|
||||||
#ifdef WOLFSSL_AFALG
|
|
||||||
void* afalg_holder[288 / sizeof(void*)];
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_PKCS11
|
|
||||||
void* pkcs11_holder[(AES_MAX_ID_LEN + sizeof(int)) / sizeof(void*)];
|
|
||||||
#endif
|
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLF_CRYPTO_CB)
|
|
||||||
void* async_holder[128 / sizeof(void*)];
|
|
||||||
#endif
|
|
||||||
} WOLFSSL_AES_KEY;
|
} WOLFSSL_AES_KEY;
|
||||||
typedef WOLFSSL_AES_KEY AES_KEY;
|
typedef WOLFSSL_AES_KEY AES_KEY;
|
||||||
|
|
||||||
@ -78,12 +59,20 @@ WOLFSSL_API void wolfSSL_AES_ecb_encrypt
|
|||||||
WOLFSSL_API void wolfSSL_AES_cfb128_encrypt
|
WOLFSSL_API void wolfSSL_AES_cfb128_encrypt
|
||||||
(const unsigned char *in, unsigned char* out, size_t len,
|
(const unsigned char *in, unsigned char* out, size_t len,
|
||||||
AES_KEY *key, unsigned char* iv, int* num, const int enc);
|
AES_KEY *key, unsigned char* iv, int* num, const int enc);
|
||||||
|
WOLFSSL_API int wolfSSL_AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||||
|
unsigned char *out,
|
||||||
|
const unsigned char *in, unsigned int inlen);
|
||||||
|
WOLFSSL_API int wolfSSL_AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||||
|
unsigned char *out,
|
||||||
|
const unsigned char *in, unsigned int inlen);
|
||||||
|
|
||||||
#define AES_cbc_encrypt wolfSSL_AES_cbc_encrypt
|
#define AES_cbc_encrypt wolfSSL_AES_cbc_encrypt
|
||||||
#define AES_ecb_encrypt wolfSSL_AES_ecb_encrypt
|
#define AES_ecb_encrypt wolfSSL_AES_ecb_encrypt
|
||||||
#define AES_cfb128_encrypt wolfSSL_AES_cfb128_encrypt
|
#define AES_cfb128_encrypt wolfSSL_AES_cfb128_encrypt
|
||||||
#define AES_set_encrypt_key wolfSSL_AES_set_encrypt_key
|
#define AES_set_encrypt_key wolfSSL_AES_set_encrypt_key
|
||||||
#define AES_set_decrypt_key wolfSSL_AES_set_decrypt_key
|
#define AES_set_decrypt_key wolfSSL_AES_set_decrypt_key
|
||||||
|
#define AES_wrap_key wolfSSL_AES_wrap_key
|
||||||
|
#define AES_unwrap_key wolfSSL_AES_unwrap_key
|
||||||
|
|
||||||
#ifdef WOLFSSL_AES_DIRECT
|
#ifdef WOLFSSL_AES_DIRECT
|
||||||
WOLFSSL_API void wolfSSL_AES_encrypt
|
WOLFSSL_API void wolfSSL_AES_encrypt
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* asn1.h
|
/* asn1.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#ifndef WOLFSSL_ASN1_H_
|
#ifndef WOLFSSL_ASN1_H_
|
||||||
#define WOLFSSL_ASN1_H_
|
#define WOLFSSL_ASN1_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
|
|
||||||
#define ASN1_STRING_new wolfSSL_ASN1_STRING_new
|
#define ASN1_STRING_new wolfSSL_ASN1_STRING_new
|
||||||
#define ASN1_STRING_type_new wolfSSL_ASN1_STRING_type_new
|
#define ASN1_STRING_type_new wolfSSL_ASN1_STRING_type_new
|
||||||
@ -32,6 +32,10 @@
|
|||||||
#define ASN1_STRING_set wolfSSL_ASN1_STRING_set
|
#define ASN1_STRING_set wolfSSL_ASN1_STRING_set
|
||||||
#define ASN1_STRING_free wolfSSL_ASN1_STRING_free
|
#define ASN1_STRING_free wolfSSL_ASN1_STRING_free
|
||||||
|
|
||||||
|
#define ASN1_get_object wolfSSL_ASN1_get_object
|
||||||
|
#define d2i_ASN1_OBJECT wolfSSL_d2i_ASN1_OBJECT
|
||||||
|
#define c2i_ASN1_OBJECT wolfSSL_c2i_ASN1_OBJECT
|
||||||
|
|
||||||
#define V_ASN1_INTEGER 0x02
|
#define V_ASN1_INTEGER 0x02
|
||||||
#define V_ASN1_OCTET_STRING 0x04 /* tag for ASN1_OCTET_STRING */
|
#define V_ASN1_OCTET_STRING 0x04 /* tag for ASN1_OCTET_STRING */
|
||||||
#define V_ASN1_NEG 0x100
|
#define V_ASN1_NEG 0x100
|
||||||
@ -66,10 +70,21 @@
|
|||||||
#define ASN1_TIME_diff wolfSSL_ASN1_TIME_diff
|
#define ASN1_TIME_diff wolfSSL_ASN1_TIME_diff
|
||||||
#define ASN1_TIME_set wolfSSL_ASN1_TIME_set
|
#define ASN1_TIME_set wolfSSL_ASN1_TIME_set
|
||||||
|
|
||||||
|
#define V_ASN1_EOC 0
|
||||||
#define V_ASN1_OBJECT 6
|
#define V_ASN1_OBJECT 6
|
||||||
|
#define V_ASN1_UTF8STRING 12
|
||||||
|
#define V_ASN1_SEQUENCE 16
|
||||||
|
#define V_ASN1_SET 17
|
||||||
|
#define V_ASN1_PRINTABLESTRING 19
|
||||||
|
#define V_ASN1_T61STRING 20
|
||||||
|
#define V_ASN1_IA5STRING 22
|
||||||
#define V_ASN1_UTCTIME 23
|
#define V_ASN1_UTCTIME 23
|
||||||
#define V_ASN1_GENERALIZEDTIME 24
|
#define V_ASN1_GENERALIZEDTIME 24
|
||||||
#define V_ASN1_PRINTABLESTRING 19
|
#define V_ASN1_UNIVERSALSTRING 28
|
||||||
|
#define V_ASN1_BMPSTRING 30
|
||||||
|
|
||||||
|
|
||||||
|
#define V_ASN1_CONSTRUCTED 0x20
|
||||||
|
|
||||||
#define ASN1_STRING_FLAG_BITS_LEFT 0x008
|
#define ASN1_STRING_FLAG_BITS_LEFT 0x008
|
||||||
#define ASN1_STRING_FLAG_NDEF 0x010
|
#define ASN1_STRING_FLAG_NDEF 0x010
|
||||||
@ -83,6 +98,12 @@ WOLFSSL_API WOLFSSL_ASN1_INTEGER *wolfSSL_BN_to_ASN1_INTEGER(
|
|||||||
|
|
||||||
WOLFSSL_API void wolfSSL_ASN1_TYPE_set(WOLFSSL_ASN1_TYPE *a, int type, void *value);
|
WOLFSSL_API void wolfSSL_ASN1_TYPE_set(WOLFSSL_ASN1_TYPE *a, int type, void *value);
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_ASN1_get_object(const unsigned char **in, long *len, int *tag,
|
||||||
|
int *cls, long inLen);
|
||||||
|
|
||||||
|
WOLFSSL_API WOLFSSL_ASN1_OBJECT *wolfSSL_c2i_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT **a,
|
||||||
|
const unsigned char **pp, long len);
|
||||||
|
|
||||||
#ifdef OPENSSL_ALL
|
#ifdef OPENSSL_ALL
|
||||||
/* IMPLEMENT_ASN1_FUNCTIONS is strictly for external use only. Internally
|
/* IMPLEMENT_ASN1_FUNCTIONS is strictly for external use only. Internally
|
||||||
* we don't use this. Some projects use OpenSSL to implement ASN1 types and
|
* we don't use this. Some projects use OpenSSL to implement ASN1 types and
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* asn1t.h
|
/* asn1t.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#ifndef WOLFSSL_ASN1T_H_
|
#ifndef WOLFSSL_ASN1T_H_
|
||||||
#define WOLFSSL_ASN1T_H_
|
#define WOLFSSL_ASN1T_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/asn.h>
|
#include <libs/libwolfssl/wolfcrypt/asn.h>
|
||||||
#include <libwolfssl/openssl/asn1.h>
|
#include <libs/libwolfssl/openssl/asn1.h>
|
||||||
|
|
||||||
#endif /* WOLFSSL_ASN1T_H_ */
|
#endif /* WOLFSSL_ASN1T_H_ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* bio.h
|
/* bio.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#ifndef WOLFSSL_BIO_H_
|
#ifndef WOLFSSL_BIO_H_
|
||||||
#define WOLFSSL_BIO_H_
|
#define WOLFSSL_BIO_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -40,7 +40,14 @@
|
|||||||
#define BIO_FLAGS_SHOULD_RETRY WOLFSSL_BIO_FLAG_RETRY
|
#define BIO_FLAGS_SHOULD_RETRY WOLFSSL_BIO_FLAG_RETRY
|
||||||
|
|
||||||
#define BIO_new_fp wolfSSL_BIO_new_fp
|
#define BIO_new_fp wolfSSL_BIO_new_fp
|
||||||
|
#if defined(OPENSSL_ALL) \
|
||||||
|
|| defined(HAVE_STUNNEL) \
|
||||||
|
|| defined(HAVE_LIGHTY) \
|
||||||
|
|| defined(WOLFSSL_MYSQL_COMPATIBLE) \
|
||||||
|
|| defined(WOLFSSL_HAPROXY) \
|
||||||
|
|| defined(OPENSSL_EXTRA)
|
||||||
#define BIO_new_file wolfSSL_BIO_new_file
|
#define BIO_new_file wolfSSL_BIO_new_file
|
||||||
|
#endif
|
||||||
#define BIO_new_fp wolfSSL_BIO_new_fp
|
#define BIO_new_fp wolfSSL_BIO_new_fp
|
||||||
#define BIO_ctrl wolfSSL_BIO_ctrl
|
#define BIO_ctrl wolfSSL_BIO_ctrl
|
||||||
#define BIO_ctrl_pending wolfSSL_BIO_ctrl_pending
|
#define BIO_ctrl_pending wolfSSL_BIO_ctrl_pending
|
||||||
@ -57,9 +64,11 @@
|
|||||||
#define BIO_set_write_buf_size wolfSSL_BIO_set_write_buf_size
|
#define BIO_set_write_buf_size wolfSSL_BIO_set_write_buf_size
|
||||||
#define BIO_make_bio_pair wolfSSL_BIO_make_bio_pair
|
#define BIO_make_bio_pair wolfSSL_BIO_make_bio_pair
|
||||||
|
|
||||||
|
#define BIO_new_fd wolfSSL_BIO_new_fd
|
||||||
#define BIO_set_fp wolfSSL_BIO_set_fp
|
#define BIO_set_fp wolfSSL_BIO_set_fp
|
||||||
#define BIO_get_fp wolfSSL_BIO_get_fp
|
#define BIO_get_fp wolfSSL_BIO_get_fp
|
||||||
#define BIO_seek wolfSSL_BIO_seek
|
#define BIO_seek wolfSSL_BIO_seek
|
||||||
|
#define BIO_tell wolfSSL_BIO_tell
|
||||||
#define BIO_write_filename wolfSSL_BIO_write_filename
|
#define BIO_write_filename wolfSSL_BIO_write_filename
|
||||||
#define BIO_set_mem_eof_return wolfSSL_BIO_set_mem_eof_return
|
#define BIO_set_mem_eof_return wolfSSL_BIO_set_mem_eof_return
|
||||||
|
|
||||||
@ -123,6 +132,7 @@
|
|||||||
#define BIO_meth_set_create wolfSSL_BIO_meth_set_create
|
#define BIO_meth_set_create wolfSSL_BIO_meth_set_create
|
||||||
#define BIO_meth_set_destroy wolfSSL_BIO_meth_set_destroy
|
#define BIO_meth_set_destroy wolfSSL_BIO_meth_set_destroy
|
||||||
|
|
||||||
|
#define BIO_snprintf XSNPRINTF
|
||||||
|
|
||||||
/* BIO CTRL */
|
/* BIO CTRL */
|
||||||
#define BIO_CTRL_RESET 1
|
#define BIO_CTRL_RESET 1
|
||||||
@ -149,6 +159,7 @@
|
|||||||
|
|
||||||
#define BIO_CTRL_DGRAM_QUERY_MTU 40
|
#define BIO_CTRL_DGRAM_QUERY_MTU 40
|
||||||
|
|
||||||
|
#define BIO_FP_TEXT 0x00
|
||||||
#define BIO_NOCLOSE 0x00
|
#define BIO_NOCLOSE 0x00
|
||||||
#define BIO_CLOSE 0x01
|
#define BIO_CLOSE 0x01
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* bn.h
|
/* bn.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -30,8 +30,8 @@
|
|||||||
#ifndef WOLFSSL_BN_H_
|
#ifndef WOLFSSL_BN_H_
|
||||||
#define WOLFSSL_BN_H_
|
#define WOLFSSL_BN_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
#include <libwolfssl/wolfcrypt/integer.h>
|
#include <libs/libwolfssl/wolfcrypt/integer.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -40,7 +40,7 @@
|
|||||||
typedef struct WOLFSSL_BIGNUM {
|
typedef struct WOLFSSL_BIGNUM {
|
||||||
int neg; /* openssh deference */
|
int neg; /* openssh deference */
|
||||||
void *internal; /* our big num */
|
void *internal; /* our big num */
|
||||||
#ifdef WOLFSSL_SP_MATH
|
#if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)
|
||||||
sp_int fp;
|
sp_int fp;
|
||||||
#elif defined(USE_FAST_MATH) && !defined(HAVE_WOLF_BIGINT)
|
#elif defined(USE_FAST_MATH) && !defined(HAVE_WOLF_BIGINT)
|
||||||
fp_int fp;
|
fp_int fp;
|
||||||
@ -49,7 +49,7 @@ typedef struct WOLFSSL_BIGNUM {
|
|||||||
|
|
||||||
|
|
||||||
#define BN_ULONG WOLFSSL_BN_ULONG
|
#define BN_ULONG WOLFSSL_BN_ULONG
|
||||||
#define WOLFSSL_BN_ULONG mp_digit
|
#define WOLFSSL_BN_ULONG unsigned long
|
||||||
|
|
||||||
typedef struct WOLFSSL_BN_CTX WOLFSSL_BN_CTX;
|
typedef struct WOLFSSL_BN_CTX WOLFSSL_BN_CTX;
|
||||||
typedef struct WOLFSSL_BN_GENCB WOLFSSL_BN_GENCB;
|
typedef struct WOLFSSL_BN_GENCB WOLFSSL_BN_GENCB;
|
||||||
@ -113,7 +113,7 @@ WOLFSSL_API int wolfSSL_BN_add_word(WOLFSSL_BIGNUM*, WOLFSSL_BN_ULONG);
|
|||||||
WOLFSSL_API int wolfSSL_BN_set_bit(WOLFSSL_BIGNUM*, int);
|
WOLFSSL_API int wolfSSL_BN_set_bit(WOLFSSL_BIGNUM*, int);
|
||||||
WOLFSSL_API int wolfSSL_BN_clear_bit(WOLFSSL_BIGNUM*, int);
|
WOLFSSL_API int wolfSSL_BN_clear_bit(WOLFSSL_BIGNUM*, int);
|
||||||
WOLFSSL_API int wolfSSL_BN_set_word(WOLFSSL_BIGNUM*, WOLFSSL_BN_ULONG);
|
WOLFSSL_API int wolfSSL_BN_set_word(WOLFSSL_BIGNUM*, WOLFSSL_BN_ULONG);
|
||||||
WOLFSSL_API unsigned long wolfSSL_BN_get_word(const WOLFSSL_BIGNUM*);
|
WOLFSSL_API WOLFSSL_BN_ULONG wolfSSL_BN_get_word(const WOLFSSL_BIGNUM*);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_BN_add(WOLFSSL_BIGNUM*, WOLFSSL_BIGNUM*,
|
WOLFSSL_API int wolfSSL_BN_add(WOLFSSL_BIGNUM*, WOLFSSL_BIGNUM*,
|
||||||
WOLFSSL_BIGNUM*);
|
WOLFSSL_BIGNUM*);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* buffer.h
|
/* buffer.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -23,8 +23,8 @@
|
|||||||
#ifndef WOLFSSL_BUFFER_H_
|
#ifndef WOLFSSL_BUFFER_H_
|
||||||
#define WOLFSSL_BUFFER_H_
|
#define WOLFSSL_BUFFER_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -34,12 +34,18 @@
|
|||||||
WOLFSSL_API WOLFSSL_BUF_MEM* wolfSSL_BUF_MEM_new(void);
|
WOLFSSL_API WOLFSSL_BUF_MEM* wolfSSL_BUF_MEM_new(void);
|
||||||
WOLFSSL_API int wolfSSL_BUF_MEM_grow(WOLFSSL_BUF_MEM* buf, size_t len);
|
WOLFSSL_API int wolfSSL_BUF_MEM_grow(WOLFSSL_BUF_MEM* buf, size_t len);
|
||||||
WOLFSSL_API void wolfSSL_BUF_MEM_free(WOLFSSL_BUF_MEM* buf);
|
WOLFSSL_API void wolfSSL_BUF_MEM_free(WOLFSSL_BUF_MEM* buf);
|
||||||
|
WOLFSSL_API size_t wolfSSL_strlcpy(char *dst, const char *src, size_t dstSize);
|
||||||
|
WOLFSSL_API size_t wolfSSL_strlcat(char *dst, const char *src, size_t dstSize);
|
||||||
|
|
||||||
|
|
||||||
#define BUF_MEM_new wolfSSL_BUF_MEM_new
|
#define BUF_MEM_new wolfSSL_BUF_MEM_new
|
||||||
#define BUF_MEM_grow wolfSSL_BUF_MEM_grow
|
#define BUF_MEM_grow wolfSSL_BUF_MEM_grow
|
||||||
#define BUF_MEM_free wolfSSL_BUF_MEM_free
|
#define BUF_MEM_free wolfSSL_BUF_MEM_free
|
||||||
|
|
||||||
|
#define BUF_strdup strdup
|
||||||
|
#define BUF_strlcpy wolfSSL_strlcpy
|
||||||
|
#define BUF_strlcat wolfSSL_strlcat
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* conf.h
|
/* conf.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -28,18 +28,83 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct WOLFSSL_CONF_VALUE {
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
#include <libs/libwolfssl/version.h>
|
||||||
|
|
||||||
|
typedef struct WOLFSSL_CONF_VALUE {
|
||||||
char *section;
|
char *section;
|
||||||
char *name;
|
char *name;
|
||||||
char *value;
|
char *value;
|
||||||
};
|
} WOLFSSL_CONF_VALUE;
|
||||||
|
|
||||||
struct WOLFSSL_INIT_SETTINGS {
|
/* ssl.h requires WOLFSSL_CONF_VALUE */
|
||||||
char* appname;
|
#include <libs/libwolfssl/ssl.h>
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct WOLFSSL_CONF_VALUE CONF_VALUE;
|
typedef struct WOLFSSL_CONF {
|
||||||
typedef struct WOLFSSL_INIT_SETTINGS OPENSSL_INIT_SETTINGS;
|
void *meth_data;
|
||||||
|
WOLF_LHASH_OF(WOLFSSL_CONF_VALUE) *data;
|
||||||
|
} WOLFSSL_CONF;
|
||||||
|
|
||||||
|
typedef WOLFSSL_CONF CONF;
|
||||||
|
typedef WOLFSSL_CONF_VALUE CONF_VALUE;
|
||||||
|
|
||||||
|
#ifdef OPENSSL_EXTRA
|
||||||
|
|
||||||
|
WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_VALUE_new(void);
|
||||||
|
WOLFSSL_API int wolfSSL_CONF_add_string(WOLFSSL_CONF *conf,
|
||||||
|
WOLFSSL_CONF_VALUE *section, WOLFSSL_CONF_VALUE *value);
|
||||||
|
WOLFSSL_API void wolfSSL_X509V3_conf_free(WOLFSSL_CONF_VALUE *val);
|
||||||
|
|
||||||
|
WOLFSSL_API WOLFSSL_CONF *wolfSSL_NCONF_new(void *meth);
|
||||||
|
WOLFSSL_API char *wolfSSL_NCONF_get_string(const WOLFSSL_CONF *conf,
|
||||||
|
const char *group, const char *name);
|
||||||
|
WOLFSSL_API int wolfSSL_NCONF_get_number(const CONF *conf, const char *group,
|
||||||
|
const char *name, long *result);
|
||||||
|
WOLFSSL_API WOLFSSL_STACK *wolfSSL_NCONF_get_section(
|
||||||
|
const WOLFSSL_CONF *conf, const char *section);
|
||||||
|
WOLFSSL_API int wolfSSL_NCONF_load(WOLFSSL_CONF *conf, const char *file, long *eline);
|
||||||
|
WOLFSSL_API void wolfSSL_NCONF_free(WOLFSSL_CONF *conf);
|
||||||
|
|
||||||
|
WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_lh_WOLFSSL_CONF_VALUE_retrieve(
|
||||||
|
WOLF_LHASH_OF(WOLFSSL_CONF_VALUE) *sk, WOLFSSL_CONF_VALUE *data);
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_CONF_modules_load(const WOLFSSL_CONF *cnf, const char *appname,
|
||||||
|
unsigned long flags);
|
||||||
|
WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_new_section(WOLFSSL_CONF *conf,
|
||||||
|
const char *section);
|
||||||
|
WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_get_section(WOLFSSL_CONF *conf,
|
||||||
|
const char *section);
|
||||||
|
|
||||||
|
WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509V3_EXT_nconf_nid(WOLFSSL_CONF* conf,
|
||||||
|
WOLFSSL_X509V3_CTX *ctx, int nid, const char *value);
|
||||||
|
WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509V3_EXT_nconf(WOLFSSL_CONF *conf,
|
||||||
|
WOLFSSL_X509V3_CTX *ctx, const char *sName, const char *value);
|
||||||
|
|
||||||
|
#define sk_CONF_VALUE_new wolfSSL_sk_CONF_VALUE_new
|
||||||
|
#define sk_CONF_VALUE_free wolfSSL_sk_CONF_VALUE_free
|
||||||
|
#define sk_CONF_VALUE_pop_free(a,b) wolfSSL_sk_CONF_VALUE_free(a)
|
||||||
|
#define sk_CONF_VALUE_num wolfSSL_sk_CONF_VALUE_num
|
||||||
|
#define sk_CONF_VALUE_value wolfSSL_sk_CONF_VALUE_value
|
||||||
|
|
||||||
|
#define lh_CONF_VALUE_retrieve wolfSSL_lh_WOLFSSL_CONF_VALUE_retrieve
|
||||||
|
#define lh_CONF_VALUE_insert wolfSSL_sk_CONF_VALUE_push
|
||||||
|
|
||||||
|
#define NCONF_new wolfSSL_NCONF_new
|
||||||
|
#define NCONF_free wolfSSL_NCONF_free
|
||||||
|
#define NCONF_get_string wolfSSL_NCONF_get_string
|
||||||
|
#define NCONF_get_section wolfSSL_NCONF_get_section
|
||||||
|
#define NCONF_get_number wolfSSL_NCONF_get_number
|
||||||
|
#define NCONF_load wolfSSL_NCONF_load
|
||||||
|
|
||||||
|
#define CONF_modules_load wolfSSL_CONF_modules_load
|
||||||
|
#define _CONF_new_section wolfSSL_CONF_new_section
|
||||||
|
#define _CONF_get_section wolfSSL_CONF_get_section
|
||||||
|
|
||||||
|
#define X509V3_EXT_nconf_nid wolfSSL_X509V3_EXT_nconf_nid
|
||||||
|
#define X509V3_EXT_nconf wolfSSL_X509V3_EXT_nconf
|
||||||
|
#define X509V3_conf_free wolfSSL_X509V3_conf_free
|
||||||
|
|
||||||
|
#endif /* OPENSSL_EXTRA */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* crypto.h
|
/* crypto.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,15 +24,29 @@
|
|||||||
#ifndef WOLFSSL_CRYPTO_H_
|
#ifndef WOLFSSL_CRYPTO_H_
|
||||||
#define WOLFSSL_CRYPTO_H_
|
#define WOLFSSL_CRYPTO_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/opensslv.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
typedef struct WOLFSSL_INIT_SETTINGS {
|
||||||
|
char* appname;
|
||||||
|
} WOLFSSL_INIT_SETTINGS;
|
||||||
|
typedef WOLFSSL_INIT_SETTINGS OPENSSL_INIT_SETTINGS;
|
||||||
|
|
||||||
|
typedef struct WOLFSSL_CRYPTO_THREADID {
|
||||||
|
int dummy;
|
||||||
|
} WOLFSSL_CRYPTO_THREADID;
|
||||||
|
typedef struct crypto_threadid_st CRYPTO_THREADID;
|
||||||
|
|
||||||
|
typedef struct CRYPTO_EX_DATA CRYPTO_EX_DATA;
|
||||||
|
typedef void (CRYPTO_free_func)(void* parent, void* ptr, CRYPTO_EX_DATA* ad, int idx,
|
||||||
|
long argl, void* argp);
|
||||||
|
|
||||||
|
#include <libs/libwolfssl/openssl/opensslv.h>
|
||||||
|
#include <libs/libwolfssl/openssl/conf.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_crypto.h"
|
#include "prefix_crypto.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
WOLFSSL_API const char* wolfSSLeay_version(int type);
|
WOLFSSL_API const char* wolfSSLeay_version(int type);
|
||||||
WOLFSSL_API unsigned long wolfSSLeay(void);
|
WOLFSSL_API unsigned long wolfSSLeay(void);
|
||||||
WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void);
|
WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void);
|
||||||
@ -40,9 +54,14 @@ WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void);
|
|||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
WOLFSSL_API void wolfSSL_OPENSSL_free(void*);
|
WOLFSSL_API void wolfSSL_OPENSSL_free(void*);
|
||||||
WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a);
|
WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a);
|
||||||
|
WOLFSSL_API int wolfSSL_OPENSSL_hexchar2int(unsigned char c);
|
||||||
|
WOLFSSL_API unsigned char *wolfSSL_OPENSSL_hexstr2buf(const char *str, long *len);
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_OPENSSL_init_crypto(word64 opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CRYPTO_THREADID void
|
#define crypto_threadid_st WOLFSSL_CRYPTO_THREADID
|
||||||
|
#define CRYPTO_THREADID WOLFSSL_CRYPTO_THREADID
|
||||||
|
|
||||||
#define SSLeay_version wolfSSLeay_version
|
#define SSLeay_version wolfSSLeay_version
|
||||||
#define SSLeay wolfSSLeay
|
#define SSLeay wolfSSLeay
|
||||||
@ -61,23 +80,35 @@ WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a);
|
|||||||
|
|
||||||
#define OPENSSL_free wolfSSL_OPENSSL_free
|
#define OPENSSL_free wolfSSL_OPENSSL_free
|
||||||
#define OPENSSL_malloc wolfSSL_OPENSSL_malloc
|
#define OPENSSL_malloc wolfSSL_OPENSSL_malloc
|
||||||
|
#define OPENSSL_hexchar2int wolfSSL_OPENSSL_hexchar2int
|
||||||
|
#define OPENSSL_hexstr2buf wolfSSL_OPENSSL_hexstr2buf
|
||||||
|
|
||||||
#ifdef WOLFSSL_QT
|
#define OPENSSL_INIT_ENGINE_ALL_BUILTIN 0x00000001L
|
||||||
#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
|
#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
|
||||||
#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
|
#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
|
||||||
#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
|
#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
|
||||||
|
|
||||||
|
#define OPENSSL_init_crypto wolfSSL_OPENSSL_init_crypto
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_OPENVPN
|
||||||
|
# define OPENSSL_assert(e) \
|
||||||
|
if (!(e)) { \
|
||||||
|
fprintf(stderr, "%s:%d wolfSSL internal error: assertion failed: " #e, \
|
||||||
|
__FILE__, __LINE__); \
|
||||||
|
raise(SIGABRT); \
|
||||||
|
_exit(3); \
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \
|
#if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \
|
||||||
defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA)
|
defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_EX_DATA)
|
||||||
#define CRYPTO_set_mem_ex_functions wolfSSL_CRYPTO_set_mem_ex_functions
|
#define CRYPTO_set_mem_ex_functions wolfSSL_CRYPTO_set_mem_ex_functions
|
||||||
#define FIPS_mode wolfSSL_FIPS_mode
|
#define FIPS_mode wolfSSL_FIPS_mode
|
||||||
#define FIPS_mode_set wolfSSL_FIPS_mode_set
|
#define FIPS_mode_set wolfSSL_FIPS_mode_set
|
||||||
typedef struct CRYPTO_EX_DATA CRYPTO_EX_DATA;
|
|
||||||
typedef void (CRYPTO_free_func)(void*parent, void*ptr, CRYPTO_EX_DATA *ad, int idx,
|
|
||||||
long argl, void* argp);
|
|
||||||
#define CRYPTO_THREADID_set_callback wolfSSL_THREADID_set_callback
|
#define CRYPTO_THREADID_set_callback wolfSSL_THREADID_set_callback
|
||||||
#define CRYPTO_THREADID_set_numeric wolfSSL_THREADID_set_numeric
|
#define CRYPTO_THREADID_set_numeric wolfSSL_THREADID_set_numeric
|
||||||
|
#define CRYPTO_THREADID_current wolfSSL_THREADID_current
|
||||||
|
#define CRYPTO_THREADID_hash wolfSSL_THREADID_hash
|
||||||
|
|
||||||
#define CRYPTO_r_lock wc_LockMutex_ex
|
#define CRYPTO_r_lock wc_LockMutex_ex
|
||||||
#define CRYPTO_unlock wc_LockMutex_ex
|
#define CRYPTO_unlock wc_LockMutex_ex
|
||||||
@ -86,6 +117,13 @@ typedef void (CRYPTO_free_func)(void*parent, void*ptr, CRYPTO_EX_DATA *ad, int i
|
|||||||
#define CRYPTO_THREAD_r_lock wc_LockMutex
|
#define CRYPTO_THREAD_r_lock wc_LockMutex
|
||||||
#define CRYPTO_THREAD_unlock wc_UnLockMutex
|
#define CRYPTO_THREAD_unlock wc_UnLockMutex
|
||||||
|
|
||||||
#endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */
|
#define CRYPTO_THREAD_lock_new wc_InitAndAllocMutex
|
||||||
|
#define CRYPTO_THREAD_read_lock wc_LockMutex
|
||||||
|
#define CRYPTO_THREAD_write_lock wc_LockMutex
|
||||||
|
#define CRYPTO_THREAD_lock_free wc_FreeMutex
|
||||||
|
|
||||||
|
#define CRYPTO_set_ex_data wolfSSL_CRYPTO_set_ex_data
|
||||||
|
|
||||||
|
#endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || HAVE_EX_DATA */
|
||||||
|
|
||||||
#endif /* header */
|
#endif /* header */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* des.h
|
/* des.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -29,7 +29,7 @@
|
|||||||
#ifndef WOLFSSL_DES_H_
|
#ifndef WOLFSSL_DES_H_
|
||||||
#define WOLFSSL_DES_H_
|
#define WOLFSSL_DES_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifndef NO_DES3
|
#ifndef NO_DES3
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* dh.h
|
/* dh.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,7 +25,8 @@
|
|||||||
#ifndef WOLFSSL_DH_H_
|
#ifndef WOLFSSL_DH_H_
|
||||||
#define WOLFSSL_DH_H_
|
#define WOLFSSL_DH_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
|
#include <libs/libwolfssl/openssl/opensslv.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -58,16 +59,17 @@ WOLFSSL_API WOLFSSL_DH *wolfSSL_d2i_DHparams(WOLFSSL_DH **dh,
|
|||||||
WOLFSSL_API int wolfSSL_i2d_DHparams(const WOLFSSL_DH *dh, unsigned char **out);
|
WOLFSSL_API int wolfSSL_i2d_DHparams(const WOLFSSL_DH *dh, unsigned char **out);
|
||||||
WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
|
WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
|
||||||
WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH*);
|
WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH*);
|
||||||
|
WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_dup(WOLFSSL_DH* dh);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_DH_check(const WOLFSSL_DH *dh, int *codes);
|
WOLFSSL_API int wolfSSL_DH_check(const WOLFSSL_DH *dh, int *codes);
|
||||||
WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*);
|
WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*);
|
||||||
WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*);
|
WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*);
|
||||||
WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, WOLFSSL_BIGNUM* pub,
|
WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, const WOLFSSL_BIGNUM* pub,
|
||||||
WOLFSSL_DH*);
|
WOLFSSL_DH*);
|
||||||
WOLFSSL_API int wolfSSL_DH_LoadDer(WOLFSSL_DH*, const unsigned char*, int sz);
|
WOLFSSL_API int wolfSSL_DH_LoadDer(WOLFSSL_DH*, const unsigned char*, int sz);
|
||||||
WOLFSSL_API int wolfSSL_DH_set0_pqg(WOLFSSL_DH*, WOLFSSL_BIGNUM*,
|
WOLFSSL_API int wolfSSL_DH_set0_pqg(WOLFSSL_DH*, WOLFSSL_BIGNUM*,
|
||||||
WOLFSSL_BIGNUM*, WOLFSSL_BIGNUM*);
|
WOLFSSL_BIGNUM*, WOLFSSL_BIGNUM*);
|
||||||
|
|
||||||
#define DH_new wolfSSL_DH_new
|
#define DH_new wolfSSL_DH_new
|
||||||
#define DH_free wolfSSL_DH_free
|
#define DH_free wolfSSL_DH_free
|
||||||
|
|
||||||
@ -78,9 +80,10 @@ WOLFSSL_API int wolfSSL_DH_set0_pqg(WOLFSSL_DH*, WOLFSSL_BIGNUM*,
|
|||||||
#define DH_size wolfSSL_DH_size
|
#define DH_size wolfSSL_DH_size
|
||||||
#define DH_generate_key wolfSSL_DH_generate_key
|
#define DH_generate_key wolfSSL_DH_generate_key
|
||||||
#define DH_compute_key wolfSSL_DH_compute_key
|
#define DH_compute_key wolfSSL_DH_compute_key
|
||||||
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
|
|
||||||
#define DH_set0_pqg wolfSSL_DH_set0_pqg
|
#define DH_set0_pqg wolfSSL_DH_set0_pqg
|
||||||
#endif
|
#define DH_get0_pqg wolfSSL_DH_get0_pqg
|
||||||
|
#define DH_get0_key wolfSSL_DH_get0_key
|
||||||
|
#define DH_set0_key wolfSSL_DH_set0_key
|
||||||
#define DH_bits(x) (BN_num_bits(x->p))
|
#define DH_bits(x) (BN_num_bits(x->p))
|
||||||
|
|
||||||
#define DH_GENERATOR_2 2
|
#define DH_GENERATOR_2 2
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* dsa.h
|
/* dsa.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#ifndef WOLFSSL_DSA_H_
|
#ifndef WOLFSSL_DSA_H_
|
||||||
#define WOLFSSL_DSA_H_
|
#define WOLFSSL_DSA_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -68,6 +68,17 @@ WOLFSSL_API int wolfSSL_DSA_generate_parameters_ex(WOLFSSL_DSA*, int bits,
|
|||||||
unsigned char* seed, int seedLen, int* counterRet,
|
unsigned char* seed, int seedLen, int* counterRet,
|
||||||
unsigned long* hRet, void* cb);
|
unsigned long* hRet, void* cb);
|
||||||
|
|
||||||
|
WOLFSSL_API void wolfSSL_DSA_get0_pqg(const WOLFSSL_DSA *d, const WOLFSSL_BIGNUM **p,
|
||||||
|
const WOLFSSL_BIGNUM **q, const WOLFSSL_BIGNUM **g);
|
||||||
|
WOLFSSL_API int wolfSSL_DSA_set0_pqg(WOLFSSL_DSA *d, WOLFSSL_BIGNUM *p,
|
||||||
|
WOLFSSL_BIGNUM *q, WOLFSSL_BIGNUM *g);
|
||||||
|
|
||||||
|
WOLFSSL_API void wolfSSL_DSA_get0_key(const WOLFSSL_DSA *d,
|
||||||
|
const WOLFSSL_BIGNUM **pub_key, const WOLFSSL_BIGNUM **priv_key);
|
||||||
|
WOLFSSL_API int wolfSSL_DSA_set0_key(WOLFSSL_DSA *d, WOLFSSL_BIGNUM *pub_key,
|
||||||
|
WOLFSSL_BIGNUM *priv_key);
|
||||||
|
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_DSA_LoadDer(WOLFSSL_DSA*, const unsigned char*, int sz);
|
WOLFSSL_API int wolfSSL_DSA_LoadDer(WOLFSSL_DSA*, const unsigned char*, int sz);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_DSA_LoadDer_ex(WOLFSSL_DSA*, const unsigned char*,
|
WOLFSSL_API int wolfSSL_DSA_LoadDer_ex(WOLFSSL_DSA*, const unsigned char*,
|
||||||
@ -84,8 +95,17 @@ WOLFSSL_API int wolfSSL_DSA_bits(const WOLFSSL_DSA *d);
|
|||||||
|
|
||||||
WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_SIG_new(void);
|
WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_SIG_new(void);
|
||||||
WOLFSSL_API void wolfSSL_DSA_SIG_free(WOLFSSL_DSA_SIG *sig);
|
WOLFSSL_API void wolfSSL_DSA_SIG_free(WOLFSSL_DSA_SIG *sig);
|
||||||
|
|
||||||
|
WOLFSSL_API void wolfSSL_DSA_SIG_get0(const WOLFSSL_DSA_SIG *sig,
|
||||||
|
const WOLFSSL_BIGNUM **r, const WOLFSSL_BIGNUM **s);
|
||||||
|
WOLFSSL_API int wolfSSL_DSA_SIG_set0(WOLFSSL_DSA_SIG *sig, WOLFSSL_BIGNUM *r,
|
||||||
|
WOLFSSL_BIGNUM *s);
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_i2d_DSA_SIG(const WOLFSSL_DSA_SIG *sig, byte **out);
|
||||||
|
WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_d2i_DSA_SIG(WOLFSSL_DSA_SIG **sig,
|
||||||
|
const unsigned char **pp, long length);
|
||||||
WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_do_sign_ex(const unsigned char* digest,
|
WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_do_sign_ex(const unsigned char* digest,
|
||||||
int outLen, WOLFSSL_DSA* dsa);
|
int inLen, WOLFSSL_DSA* dsa);
|
||||||
WOLFSSL_API int wolfSSL_DSA_do_verify_ex(const unsigned char* digest, int digest_len,
|
WOLFSSL_API int wolfSSL_DSA_do_verify_ex(const unsigned char* digest, int digest_len,
|
||||||
WOLFSSL_DSA_SIG* sig, WOLFSSL_DSA* dsa);
|
WOLFSSL_DSA_SIG* sig, WOLFSSL_DSA* dsa);
|
||||||
|
|
||||||
@ -99,9 +119,17 @@ WOLFSSL_API int wolfSSL_DSA_do_verify_ex(const unsigned char* digest, int digest
|
|||||||
#define DSA_generate_key wolfSSL_DSA_generate_key
|
#define DSA_generate_key wolfSSL_DSA_generate_key
|
||||||
#define DSA_generate_parameters wolfSSL_DSA_generate_parameters
|
#define DSA_generate_parameters wolfSSL_DSA_generate_parameters
|
||||||
#define DSA_generate_parameters_ex wolfSSL_DSA_generate_parameters_ex
|
#define DSA_generate_parameters_ex wolfSSL_DSA_generate_parameters_ex
|
||||||
|
#define DSA_get0_pqg wolfSSL_DSA_get0_pqg
|
||||||
|
#define DSA_set0_pqg wolfSSL_DSA_set0_pqg
|
||||||
|
#define DSA_get0_key wolfSSL_DSA_get0_key
|
||||||
|
#define DSA_set0_key wolfSSL_DSA_set0_key
|
||||||
|
|
||||||
#define DSA_SIG_new wolfSSL_DSA_SIG_new
|
#define DSA_SIG_new wolfSSL_DSA_SIG_new
|
||||||
#define DSA_SIG_free wolfSSL_DSA_SIG_free
|
#define DSA_SIG_free wolfSSL_DSA_SIG_free
|
||||||
|
#define DSA_SIG_get0 wolfSSL_DSA_SIG_get0
|
||||||
|
#define DSA_SIG_set0 wolfSSL_DSA_SIG_set0
|
||||||
|
#define i2d_DSA_SIG wolfSSL_i2d_DSA_SIG
|
||||||
|
#define d2i_DSA_SIG wolfSSL_d2i_DSA_SIG
|
||||||
#define DSA_do_sign wolfSSL_DSA_do_sign_ex
|
#define DSA_do_sign wolfSSL_DSA_do_sign_ex
|
||||||
#define DSA_do_verify wolfSSL_DSA_do_verify_ex
|
#define DSA_do_verify wolfSSL_DSA_do_verify_ex
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ec.h
|
/* ec.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,8 +24,9 @@
|
|||||||
#ifndef WOLFSSL_EC_H_
|
#ifndef WOLFSSL_EC_H_
|
||||||
#define WOLFSSL_EC_H_
|
#define WOLFSSL_EC_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
#include <libwolfssl/wolfcrypt/ecc.h>
|
#include <libs/libwolfssl/wolfcrypt/asn.h>
|
||||||
|
#include <libs/libwolfssl/wolfcrypt/ecc.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -68,6 +69,13 @@ enum {
|
|||||||
NID_brainpoolP512r1 = 933,
|
NID_brainpoolP512r1 = 933,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ED448
|
||||||
|
NID_ED448 = ED448k,
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ED25519
|
||||||
|
NID_ED25519 = ED25519k,
|
||||||
|
#endif
|
||||||
|
|
||||||
OPENSSL_EC_NAMED_CURVE = 0x001
|
OPENSSL_EC_NAMED_CURVE = 0x001
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -109,10 +117,13 @@ struct WOLFSSL_EC_KEY {
|
|||||||
WOLFSSL_BIGNUM *priv_key;
|
WOLFSSL_BIGNUM *priv_key;
|
||||||
|
|
||||||
void* internal; /* our ECC Key */
|
void* internal; /* our ECC Key */
|
||||||
char inSet; /* internal set from external ? */
|
|
||||||
char exSet; /* external set from internal ? */
|
|
||||||
char form; /* Either POINT_CONVERSION_UNCOMPRESSED or
|
char form; /* Either POINT_CONVERSION_UNCOMPRESSED or
|
||||||
* POINT_CONVERSION_COMPRESSED */
|
* POINT_CONVERSION_COMPRESSED */
|
||||||
|
word16 pkcs8HeaderSz;
|
||||||
|
|
||||||
|
/* option bits */
|
||||||
|
byte inSet:1; /* internal set from external ? */
|
||||||
|
byte exSet:1; /* external set from internal ? */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WOLFSSL_EC_BUILTIN_CURVE {
|
struct WOLFSSL_EC_BUILTIN_CURVE {
|
||||||
@ -146,6 +157,9 @@ int wolfSSL_EC_POINT_oct2point(const WOLFSSL_EC_GROUP *group,
|
|||||||
WOLFSSL_EC_POINT *p, const unsigned char *buf,
|
WOLFSSL_EC_POINT *p, const unsigned char *buf,
|
||||||
size_t len, WOLFSSL_BN_CTX *ctx);
|
size_t len, WOLFSSL_BN_CTX *ctx);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
|
WOLFSSL_EC_KEY *wolfSSL_o2i_ECPublicKey(WOLFSSL_EC_KEY **a, const unsigned char **in,
|
||||||
|
long len);
|
||||||
|
WOLFSSL_API
|
||||||
int wolfSSL_i2o_ECPublicKey(const WOLFSSL_EC_KEY *in, unsigned char **out);
|
int wolfSSL_i2o_ECPublicKey(const WOLFSSL_EC_KEY *in, unsigned char **out);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
WOLFSSL_EC_KEY *wolfSSL_d2i_ECPrivateKey(WOLFSSL_EC_KEY **key, const unsigned char **in,
|
WOLFSSL_EC_KEY *wolfSSL_d2i_ECPrivateKey(WOLFSSL_EC_KEY **key, const unsigned char **in,
|
||||||
@ -184,6 +198,7 @@ WOLFSSL_BIGNUM *wolfSSL_EC_KEY_get0_private_key(const WOLFSSL_EC_KEY *key);
|
|||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_by_curve_name(int nid);
|
WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_by_curve_name(int nid);
|
||||||
WOLFSSL_API const char* wolfSSL_EC_curve_nid2nist(int nid);
|
WOLFSSL_API const char* wolfSSL_EC_curve_nid2nist(int nid);
|
||||||
|
WOLFSSL_API int wolfSSL_EC_curve_nist2nid(const char* name);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new(void);
|
WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new(void);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
@ -195,6 +210,7 @@ void wolfSSL_EC_KEY_set_asn1_flag(WOLFSSL_EC_KEY *key, int asn1_flag);
|
|||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wolfSSL_EC_KEY_set_public_key(WOLFSSL_EC_KEY *key,
|
int wolfSSL_EC_KEY_set_public_key(WOLFSSL_EC_KEY *key,
|
||||||
const WOLFSSL_EC_POINT *pub);
|
const WOLFSSL_EC_POINT *pub);
|
||||||
|
WOLFSSL_API int wolfSSL_EC_KEY_check_key(const WOLFSSL_EC_KEY *key);
|
||||||
WOLFSSL_API int wolfSSL_ECDSA_size(const WOLFSSL_EC_KEY *key);
|
WOLFSSL_API int wolfSSL_ECDSA_size(const WOLFSSL_EC_KEY *key);
|
||||||
WOLFSSL_API int wolfSSL_ECDSA_sign(int type, const unsigned char *digest,
|
WOLFSSL_API int wolfSSL_ECDSA_sign(int type, const unsigned char *digest,
|
||||||
int digestSz, unsigned char *sig,
|
int digestSz, unsigned char *sig,
|
||||||
@ -287,6 +303,7 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
#define EC_KEY_generate_key wolfSSL_EC_KEY_generate_key
|
#define EC_KEY_generate_key wolfSSL_EC_KEY_generate_key
|
||||||
#define EC_KEY_set_asn1_flag wolfSSL_EC_KEY_set_asn1_flag
|
#define EC_KEY_set_asn1_flag wolfSSL_EC_KEY_set_asn1_flag
|
||||||
#define EC_KEY_set_public_key wolfSSL_EC_KEY_set_public_key
|
#define EC_KEY_set_public_key wolfSSL_EC_KEY_set_public_key
|
||||||
|
#define EC_KEY_check_key wolfSSL_EC_KEY_check_key
|
||||||
|
|
||||||
#define ECDSA_size wolfSSL_ECDSA_size
|
#define ECDSA_size wolfSSL_ECDSA_size
|
||||||
#define ECDSA_sign wolfSSL_ECDSA_sign
|
#define ECDSA_sign wolfSSL_ECDSA_sign
|
||||||
@ -301,6 +318,9 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
#define EC_GROUP_get_order wolfSSL_EC_GROUP_get_order
|
#define EC_GROUP_get_order wolfSSL_EC_GROUP_get_order
|
||||||
#define EC_GROUP_order_bits wolfSSL_EC_GROUP_order_bits
|
#define EC_GROUP_order_bits wolfSSL_EC_GROUP_order_bits
|
||||||
#define EC_GROUP_method_of wolfSSL_EC_GROUP_method_of
|
#define EC_GROUP_method_of wolfSSL_EC_GROUP_method_of
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define EC_GROUP_set_point_conversion_form(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EC_METHOD_get_field_type wolfSSL_EC_METHOD_get_field_type
|
#define EC_METHOD_get_field_type wolfSSL_EC_METHOD_get_field_type
|
||||||
|
|
||||||
@ -326,6 +346,7 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
#define EC_POINT_oct2point wolfSSL_EC_POINT_oct2point
|
#define EC_POINT_oct2point wolfSSL_EC_POINT_oct2point
|
||||||
#define EC_POINT_point2bn wolfSSL_EC_POINT_point2bn
|
#define EC_POINT_point2bn wolfSSL_EC_POINT_point2bn
|
||||||
#define EC_POINT_is_on_curve wolfSSL_EC_POINT_is_on_curve
|
#define EC_POINT_is_on_curve wolfSSL_EC_POINT_is_on_curve
|
||||||
|
#define o2i_ECPublicKey wolfSSL_o2i_ECPublicKey
|
||||||
#define i2o_ECPublicKey wolfSSL_i2o_ECPublicKey
|
#define i2o_ECPublicKey wolfSSL_i2o_ECPublicKey
|
||||||
#define i2d_EC_PUBKEY wolfSSL_i2o_ECPublicKey
|
#define i2d_EC_PUBKEY wolfSSL_i2o_ECPublicKey
|
||||||
#define d2i_ECPrivateKey wolfSSL_d2i_ECPrivateKey
|
#define d2i_ECPrivateKey wolfSSL_d2i_ECPrivateKey
|
||||||
@ -340,6 +361,7 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
#define EC_get_builtin_curves wolfSSL_EC_get_builtin_curves
|
#define EC_get_builtin_curves wolfSSL_EC_get_builtin_curves
|
||||||
|
|
||||||
#define EC_curve_nid2nist wolfSSL_EC_curve_nid2nist
|
#define EC_curve_nid2nist wolfSSL_EC_curve_nid2nist
|
||||||
|
#define EC_curve_nist2nid wolfSSL_EC_curve_nist2nid
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ec25519.h
|
/* ec25519.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ec448.h
|
/* ec448.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ecdh.h
|
/* ecdh.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,8 +24,8 @@
|
|||||||
#ifndef WOLFSSL_ECDH_H_
|
#ifndef WOLFSSL_ECDH_H_
|
||||||
#define WOLFSSL_ECDH_H_
|
#define WOLFSSL_ECDH_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ecdsa.h
|
/* ecdsa.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,8 +24,8 @@
|
|||||||
#ifndef WOLFSSL_ECDSA_H_
|
#ifndef WOLFSSL_ECDSA_H_
|
||||||
#define WOLFSSL_ECDSA_H_
|
#define WOLFSSL_ECDSA_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
#include <libwolfssl/openssl/ec.h>
|
#include <libs/libwolfssl/openssl/ec.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ed25519.h
|
/* ed25519.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ed448.h
|
/* ed448.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
/* engine.h for libcurl */
|
/* engine.h for libcurl */
|
||||||
|
|
||||||
#include <libwolfssl/openssl/err.h>
|
#include <libs/libwolfssl/openssl/err.h>
|
||||||
|
|
||||||
#undef HAVE_OPENSSL_ENGINE_H
|
#undef HAVE_OPENSSL_ENGINE_H
|
||||||
|
|
||||||
#define ENGINE_load_builtin_engines() /*ENGINE_load_builtin_engines not needed*/
|
/* ENGINE_load_builtin_engines not needed, as all builtin engines are already
|
||||||
|
loaded into memory and used on startup. */
|
||||||
|
#define ENGINE_load_builtin_engines()
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* err.h
|
/* err.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#ifndef WOLFSSL_OPENSSL_ERR_
|
#ifndef WOLFSSL_OPENSSL_ERR_
|
||||||
#define WOLFSSL_OPENSSL_ERR_
|
#define WOLFSSL_OPENSSL_ERR_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/logging.h>
|
#include <libs/libwolfssl/wolfcrypt/logging.h>
|
||||||
|
|
||||||
/* err.h for openssl */
|
/* err.h for openssl */
|
||||||
#define ERR_load_crypto_strings wolfSSL_ERR_load_crypto_strings
|
#define ERR_load_crypto_strings wolfSSL_ERR_load_crypto_strings
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* evp.h
|
/* evp.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -30,34 +30,38 @@
|
|||||||
#ifndef WOLFSSL_EVP_H_
|
#ifndef WOLFSSL_EVP_H_
|
||||||
#define WOLFSSL_EVP_H_
|
#define WOLFSSL_EVP_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_evp.h"
|
#include "prefix_evp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_MD4
|
#ifndef NO_MD4
|
||||||
#include <libwolfssl/openssl/md4.h>
|
#include <libs/libwolfssl/openssl/md4.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
#include <libwolfssl/openssl/md5.h>
|
#include <libs/libwolfssl/openssl/md5.h>
|
||||||
#endif
|
#endif
|
||||||
#include <libwolfssl/openssl/sha.h>
|
#include <libs/libwolfssl/openssl/sha.h>
|
||||||
#include <libwolfssl/openssl/sha3.h>
|
#include <libs/libwolfssl/openssl/sha3.h>
|
||||||
#include <libwolfssl/openssl/ripemd.h>
|
#include <libs/libwolfssl/openssl/ripemd.h>
|
||||||
#include <libwolfssl/openssl/rsa.h>
|
#include <libs/libwolfssl/openssl/rsa.h>
|
||||||
#include <libwolfssl/openssl/dsa.h>
|
#include <libs/libwolfssl/openssl/dsa.h>
|
||||||
#include <libwolfssl/openssl/ec.h>
|
#include <libs/libwolfssl/openssl/ec.h>
|
||||||
#include <libwolfssl/openssl/dh.h>
|
#include <libs/libwolfssl/openssl/dh.h>
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/aes.h>
|
#include <libs/libwolfssl/wolfcrypt/aes.h>
|
||||||
#include <libwolfssl/wolfcrypt/des3.h>
|
#include <libs/libwolfssl/wolfcrypt/des3.h>
|
||||||
#include <libwolfssl/wolfcrypt/arc4.h>
|
#include <libs/libwolfssl/wolfcrypt/arc4.h>
|
||||||
#include <libwolfssl/wolfcrypt/hmac.h>
|
#include <libs/libwolfssl/wolfcrypt/hmac.h>
|
||||||
#ifdef HAVE_IDEA
|
#ifdef HAVE_IDEA
|
||||||
#include <libwolfssl/wolfcrypt/idea.h>
|
#include <libs/libwolfssl/wolfcrypt/idea.h>
|
||||||
|
#endif
|
||||||
|
#include <libs/libwolfssl/wolfcrypt/pwdbased.h>
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
|
||||||
|
#include <libs/libwolfssl/wolfcrypt/coding.h>
|
||||||
#endif
|
#endif
|
||||||
#include <libwolfssl/wolfcrypt/pwdbased.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -81,6 +85,7 @@ typedef WOLFSSL_EVP_PKEY PKCS8_PRIV_KEY_INFO;
|
|||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void);
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void);
|
||||||
#endif
|
#endif
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_set_pw_prompt(const char *);
|
||||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_mdc2(void);
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_mdc2(void);
|
||||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(void);
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(void);
|
||||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha224(void);
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha224(void);
|
||||||
@ -286,6 +291,8 @@ enum {
|
|||||||
NID_sha3_256 = 1097,
|
NID_sha3_256 = 1097,
|
||||||
NID_sha3_384 = 1098,
|
NID_sha3_384 = 1098,
|
||||||
NID_sha3_512 = 1099,
|
NID_sha3_512 = 1099,
|
||||||
|
NID_blake2b512 = 1056,
|
||||||
|
NID_blake2s256 = 1057,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -372,6 +379,46 @@ struct WOLFSSL_EVP_PKEY_CTX {
|
|||||||
int nbits;
|
int nbits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef
|
||||||
|
struct WOLFSSL_ASN1_PCTX {
|
||||||
|
int dummy;
|
||||||
|
} WOLFSSL_ASN1_PCTX;
|
||||||
|
#if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
|
||||||
|
|
||||||
|
#define BASE64_ENCODE_BLOCK_SIZE 48
|
||||||
|
#define BASE64_ENCODE_RESULT_BLOCK_SIZE 64
|
||||||
|
#define BASE64_DECODE_BLOCK_SIZE 4
|
||||||
|
|
||||||
|
struct WOLFSSL_EVP_ENCODE_CTX {
|
||||||
|
void* heap;
|
||||||
|
int remaining; /* num of bytes in data[] */
|
||||||
|
byte data[BASE64_ENCODE_BLOCK_SIZE];/* storage for unprocessed raw data */
|
||||||
|
};
|
||||||
|
typedef struct WOLFSSL_EVP_ENCODE_CTX WOLFSSL_EVP_ENCODE_CTX;
|
||||||
|
|
||||||
|
WOLFSSL_API struct WOLFSSL_EVP_ENCODE_CTX* wolfSSL_EVP_ENCODE_CTX_new(void);
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_ENCODE_CTX_free(WOLFSSL_EVP_ENCODE_CTX* ctx);
|
||||||
|
#endif /* WOLFSSL_BASE64_ENCODE || WOLFSSL_BASE64_DECODE */
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_BASE64_ENCODE)
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_EncodeInit(WOLFSSL_EVP_ENCODE_CTX* ctx);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_EncodeUpdate(WOLFSSL_EVP_ENCODE_CTX* ctx,
|
||||||
|
unsigned char*out, int *outl, const unsigned char*in, int inl);
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_EncodeFinal(WOLFSSL_EVP_ENCODE_CTX* ctx,
|
||||||
|
unsigned char*out, int *outl);
|
||||||
|
#endif /* WOLFSSL_BASE64_ENCODE */
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_BASE64_DECODE)
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_DecodeInit(WOLFSSL_EVP_ENCODE_CTX* ctx);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_DecodeUpdate(WOLFSSL_EVP_ENCODE_CTX* ctx,
|
||||||
|
unsigned char*out, int *outl, const unsigned char*in, int inl);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_DecodeFinal(WOLFSSL_EVP_ENCODE_CTX* ctx,
|
||||||
|
unsigned char*out, int *outl);
|
||||||
|
#endif /* WOLFSSL_BASE64_DECODE */
|
||||||
|
|
||||||
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2b512(void);
|
||||||
|
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2s256(void);
|
||||||
|
|
||||||
typedef int WOLFSSL_ENGINE ;
|
typedef int WOLFSSL_ENGINE ;
|
||||||
typedef WOLFSSL_ENGINE ENGINE;
|
typedef WOLFSSL_ENGINE ENGINE;
|
||||||
typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
|
typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
|
||||||
@ -381,6 +428,8 @@ typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
|
|||||||
#define EVP_PKEY_OP_DECRYPT (1 << 7)
|
#define EVP_PKEY_OP_DECRYPT (1 << 7)
|
||||||
#define EVP_PKEY_OP_DERIVE (1 << 8)
|
#define EVP_PKEY_OP_DERIVE (1 << 8)
|
||||||
|
|
||||||
|
#define EVP_PKEY_PRINT_INDENT_MAX 128
|
||||||
|
|
||||||
WOLFSSL_API void wolfSSL_EVP_init(void);
|
WOLFSSL_API void wolfSSL_EVP_init(void);
|
||||||
WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
|
WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
|
||||||
WOLFSSL_API int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md);
|
WOLFSSL_API int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md);
|
||||||
@ -547,7 +596,11 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_keygen_init(WOLFSSL_EVP_PKEY_CTX *ctx);
|
|||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_keygen(WOLFSSL_EVP_PKEY_CTX *ctx,
|
WOLFSSL_API int wolfSSL_EVP_PKEY_keygen(WOLFSSL_EVP_PKEY_CTX *ctx,
|
||||||
WOLFSSL_EVP_PKEY **ppkey);
|
WOLFSSL_EVP_PKEY **ppkey);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_bits(const WOLFSSL_EVP_PKEY *pkey);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_bits(const WOLFSSL_EVP_PKEY *pkey);
|
||||||
|
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
|
WOLFSSL_API void wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
|
||||||
|
#else
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
|
||||||
|
#endif
|
||||||
WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_ENGINE *e);
|
WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_ENGINE *e);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_padding(WOLFSSL_EVP_PKEY_CTX *ctx, int padding);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_padding(WOLFSSL_EVP_PKEY_CTX *ctx, int padding);
|
||||||
WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new_id(int id, WOLFSSL_ENGINE *e);
|
WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new_id(int id, WOLFSSL_ENGINE *e);
|
||||||
@ -557,6 +610,9 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_derive_init(WOLFSSL_EVP_PKEY_CTX *ctx);
|
|||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_derive_set_peer(WOLFSSL_EVP_PKEY_CTX *ctx, WOLFSSL_EVP_PKEY *peer);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_derive_set_peer(WOLFSSL_EVP_PKEY_CTX *ctx, WOLFSSL_EVP_PKEY *peer);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
|
||||||
|
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_ctrl_str(WOLFSSL_EVP_PKEY_CTX *ctx,
|
||||||
|
const char *name, const char *value);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
|
WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
|
||||||
unsigned char *out, size_t *outlen,
|
unsigned char *out, size_t *outlen,
|
||||||
const unsigned char *in, size_t inlen);
|
const unsigned char *in, size_t inlen);
|
||||||
@ -569,11 +625,13 @@ WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_EVP_PKEY_new(void);
|
|||||||
WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_ex(void* heap);
|
WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_ex(void* heap);
|
||||||
WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY*);
|
WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY*);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_size(WOLFSSL_EVP_PKEY *pkey);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_size(WOLFSSL_EVP_PKEY *pkey);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_PKEY_copy_parameters(WOLFSSL_EVP_PKEY *to, const WOLFSSL_EVP_PKEY *from);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_missing_parameters(WOLFSSL_EVP_PKEY *pkey);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_missing_parameters(WOLFSSL_EVP_PKEY *pkey);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_cmp(const WOLFSSL_EVP_PKEY *a, const WOLFSSL_EVP_PKEY *b);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_cmp(const WOLFSSL_EVP_PKEY *a, const WOLFSSL_EVP_PKEY *b);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_type(int type);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_type(int type);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_id(const EVP_PKEY *pkey);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_id(const WOLFSSL_EVP_PKEY *pkey);
|
||||||
WOLFSSL_API int wolfSSL_EVP_PKEY_base_id(const EVP_PKEY *pkey);
|
WOLFSSL_API int wolfSSL_EVP_PKEY_base_id(const WOLFSSL_EVP_PKEY *pkey);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_PKEY_get_default_digest_nid(WOLFSSL_EVP_PKEY *pkey, int *pnid);
|
||||||
WOLFSSL_API int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
|
WOLFSSL_API int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
|
||||||
unsigned int *siglen, WOLFSSL_EVP_PKEY *pkey);
|
unsigned int *siglen, WOLFSSL_EVP_PKEY *pkey);
|
||||||
WOLFSSL_API int wolfSSL_EVP_SignInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
|
WOLFSSL_API int wolfSSL_EVP_SignInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
|
||||||
@ -582,7 +640,7 @@ WOLFSSL_API int wolfSSL_EVP_SignInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
|
|||||||
WOLFSSL_ENGINE *impl);
|
WOLFSSL_ENGINE *impl);
|
||||||
WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
|
WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
|
||||||
WOLFSSL_API int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx,
|
WOLFSSL_API int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx,
|
||||||
unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey);
|
const unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey);
|
||||||
WOLFSSL_API int wolfSSL_EVP_VerifyInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
|
WOLFSSL_API int wolfSSL_EVP_VerifyInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
|
||||||
WOLFSSL_API int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
|
WOLFSSL_API int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
|
||||||
|
|
||||||
@ -640,6 +698,8 @@ WOLFSSL_LOCAL int wolfSSL_EVP_get_hashinfo(const WOLFSSL_EVP_MD* evp,
|
|||||||
#define EVP_CIPH_CCM_MODE WOLFSSL_EVP_CIPH_CCM_MODE
|
#define EVP_CIPH_CCM_MODE WOLFSSL_EVP_CIPH_CCM_MODE
|
||||||
#define EVP_CIPH_XTS_MODE WOLFSSL_EVP_CIPH_XTS_MODE
|
#define EVP_CIPH_XTS_MODE WOLFSSL_EVP_CIPH_XTS_MODE
|
||||||
|
|
||||||
|
#define EVP_CIPH_FLAG_AEAD_CIPHER WOLFSSL_EVP_CIPH_FLAG_AEAD_CIPHER
|
||||||
|
|
||||||
#define WOLFSSL_EVP_CIPH_MODE 0x0007
|
#define WOLFSSL_EVP_CIPH_MODE 0x0007
|
||||||
#define WOLFSSL_EVP_CIPH_STREAM_CIPHER 0x0
|
#define WOLFSSL_EVP_CIPH_STREAM_CIPHER 0x0
|
||||||
#define WOLFSSL_EVP_CIPH_ECB_MODE 0x1
|
#define WOLFSSL_EVP_CIPH_ECB_MODE 0x1
|
||||||
@ -650,6 +710,7 @@ WOLFSSL_LOCAL int wolfSSL_EVP_get_hashinfo(const WOLFSSL_EVP_MD* evp,
|
|||||||
#define WOLFSSL_EVP_CIPH_GCM_MODE 0x6
|
#define WOLFSSL_EVP_CIPH_GCM_MODE 0x6
|
||||||
#define WOLFSSL_EVP_CIPH_CCM_MODE 0x7
|
#define WOLFSSL_EVP_CIPH_CCM_MODE 0x7
|
||||||
#define WOLFSSL_EVP_CIPH_XTS_MODE 0x10
|
#define WOLFSSL_EVP_CIPH_XTS_MODE 0x10
|
||||||
|
#define WOLFSSL_EVP_CIPH_FLAG_AEAD_CIPHER 0x20
|
||||||
#define WOLFSSL_EVP_CIPH_NO_PADDING 0x100
|
#define WOLFSSL_EVP_CIPH_NO_PADDING 0x100
|
||||||
#define EVP_CIPH_VARIABLE_LENGTH 0x200
|
#define EVP_CIPH_VARIABLE_LENGTH 0x200
|
||||||
#define WOLFSSL_EVP_CIPH_TYPE_INIT 0xff
|
#define WOLFSSL_EVP_CIPH_TYPE_INIT 0xff
|
||||||
@ -660,6 +721,7 @@ typedef WOLFSSL_EVP_MD EVP_MD;
|
|||||||
typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
|
typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
|
||||||
typedef WOLFSSL_EVP_MD_CTX EVP_MD_CTX;
|
typedef WOLFSSL_EVP_MD_CTX EVP_MD_CTX;
|
||||||
typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
||||||
|
typedef WOLFSSL_ASN1_PCTX ASN1_PCTX;
|
||||||
|
|
||||||
#ifndef NO_MD4
|
#ifndef NO_MD4
|
||||||
#define EVP_md4 wolfSSL_EVP_md4
|
#define EVP_md4 wolfSSL_EVP_md4
|
||||||
@ -667,14 +729,15 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
#define EVP_md5 wolfSSL_EVP_md5
|
#define EVP_md5 wolfSSL_EVP_md5
|
||||||
#endif
|
#endif
|
||||||
#define EVP_sha1 wolfSSL_EVP_sha1
|
#define EVP_sha1 wolfSSL_EVP_sha1
|
||||||
#define EVP_mdc2 wolfSSL_EVP_mdc2
|
#define EVP_mdc2 wolfSSL_EVP_mdc2
|
||||||
#define EVP_dds1 wolfSSL_EVP_sha1
|
#define EVP_dds1 wolfSSL_EVP_sha1
|
||||||
#define EVP_sha224 wolfSSL_EVP_sha224
|
#define EVP_sha224 wolfSSL_EVP_sha224
|
||||||
#define EVP_sha256 wolfSSL_EVP_sha256
|
#define EVP_sha256 wolfSSL_EVP_sha256
|
||||||
#define EVP_sha384 wolfSSL_EVP_sha384
|
#define EVP_sha384 wolfSSL_EVP_sha384
|
||||||
#define EVP_sha512 wolfSSL_EVP_sha512
|
#define EVP_sha512 wolfSSL_EVP_sha512
|
||||||
#define EVP_ripemd160 wolfSSL_EVP_ripemd160
|
#define EVP_ripemd160 wolfSSL_EVP_ripemd160
|
||||||
|
#define EVP_set_pw_prompt wolfSSL_EVP_set_pw_prompt
|
||||||
|
|
||||||
#define EVP_sha3_224 wolfSSL_EVP_sha3_224
|
#define EVP_sha3_224 wolfSSL_EVP_sha3_224
|
||||||
#define EVP_sha3_256 wolfSSL_EVP_sha3_256
|
#define EVP_sha3_256 wolfSSL_EVP_sha3_256
|
||||||
@ -727,7 +790,11 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type
|
#define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type
|
||||||
#define EVP_MD_CTX_size wolfSSL_EVP_MD_CTX_size
|
#define EVP_MD_CTX_size wolfSSL_EVP_MD_CTX_size
|
||||||
#define EVP_MD_CTX_block_size wolfSSL_EVP_MD_CTX_block_size
|
#define EVP_MD_CTX_block_size wolfSSL_EVP_MD_CTX_block_size
|
||||||
|
#define EVP_MD_block_size wolfSSL_EVP_MD_block_size
|
||||||
#define EVP_MD_type wolfSSL_EVP_MD_type
|
#define EVP_MD_type wolfSSL_EVP_MD_type
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define EVP_MD_CTX_set_flags(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EVP_Digest wolfSSL_EVP_Digest
|
#define EVP_Digest wolfSSL_EVP_Digest
|
||||||
#define EVP_DigestInit wolfSSL_EVP_DigestInit
|
#define EVP_DigestInit wolfSSL_EVP_DigestInit
|
||||||
@ -825,11 +892,14 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_PKEY_free wolfSSL_EVP_PKEY_free
|
#define EVP_PKEY_free wolfSSL_EVP_PKEY_free
|
||||||
#define EVP_PKEY_up_ref wolfSSL_EVP_PKEY_up_ref
|
#define EVP_PKEY_up_ref wolfSSL_EVP_PKEY_up_ref
|
||||||
#define EVP_PKEY_size wolfSSL_EVP_PKEY_size
|
#define EVP_PKEY_size wolfSSL_EVP_PKEY_size
|
||||||
|
#define EVP_PKEY_copy_parameters wolfSSL_EVP_PKEY_copy_parameters
|
||||||
#define EVP_PKEY_missing_parameters wolfSSL_EVP_PKEY_missing_parameters
|
#define EVP_PKEY_missing_parameters wolfSSL_EVP_PKEY_missing_parameters
|
||||||
#define EVP_PKEY_cmp wolfSSL_EVP_PKEY_cmp
|
#define EVP_PKEY_cmp wolfSSL_EVP_PKEY_cmp
|
||||||
#define EVP_PKEY_type wolfSSL_EVP_PKEY_type
|
#define EVP_PKEY_type wolfSSL_EVP_PKEY_type
|
||||||
#define EVP_PKEY_base_id wolfSSL_EVP_PKEY_base_id
|
#define EVP_PKEY_base_id wolfSSL_EVP_PKEY_base_id
|
||||||
|
#define EVP_PKEY_get_default_digest_nid wolfSSL_EVP_PKEY_get_default_digest_nid
|
||||||
#define EVP_PKEY_id wolfSSL_EVP_PKEY_id
|
#define EVP_PKEY_id wolfSSL_EVP_PKEY_id
|
||||||
|
#define EVP_PKEY_CTX_ctrl_str wolfSSL_EVP_PKEY_CTX_ctrl_str
|
||||||
#define EVP_SignFinal wolfSSL_EVP_SignFinal
|
#define EVP_SignFinal wolfSSL_EVP_SignFinal
|
||||||
#define EVP_SignInit wolfSSL_EVP_SignInit
|
#define EVP_SignInit wolfSSL_EVP_SignInit
|
||||||
#define EVP_SignInit_ex wolfSSL_EVP_SignInit_ex
|
#define EVP_SignInit_ex wolfSSL_EVP_SignInit_ex
|
||||||
@ -887,6 +957,7 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG
|
#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG
|
||||||
#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
|
#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
|
||||||
|
|
||||||
|
#define EVP_PKEY_print_public wolfSSL_EVP_PKEY_print_public
|
||||||
#define EVP_PKEY_print_private(arg1, arg2, arg3, arg4)
|
#define EVP_PKEY_print_private(arg1, arg2, arg3, arg4)
|
||||||
|
|
||||||
#ifndef EVP_MAX_MD_SIZE
|
#ifndef EVP_MAX_MD_SIZE
|
||||||
@ -917,10 +988,8 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_R_PRIVATE_KEY_DECODE_ERROR (-MIN_CODE_E + 100 + 4)
|
#define EVP_R_PRIVATE_KEY_DECODE_ERROR (-MIN_CODE_E + 100 + 4)
|
||||||
|
|
||||||
#define EVP_PKEY_NONE NID_undef
|
#define EVP_PKEY_NONE NID_undef
|
||||||
#define EVP_PKEY_RSA 6
|
|
||||||
#define EVP_PKEY_RSA2 19
|
|
||||||
#define EVP_PKEY_DH 28
|
#define EVP_PKEY_DH 28
|
||||||
#define EVP_CIPHER_mode WOLFSSL_CIPHER_mode
|
#define EVP_CIPHER_mode WOLFSSL_EVP_CIPHER_mode
|
||||||
/* WOLFSSL_EVP_CIPHER is just the string name of the cipher */
|
/* WOLFSSL_EVP_CIPHER is just the string name of the cipher */
|
||||||
#define EVP_CIPHER_name(x) x
|
#define EVP_CIPHER_name(x) x
|
||||||
#define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup
|
#define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup
|
||||||
@ -928,6 +997,25 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_MD_name(x) x
|
#define EVP_MD_name(x) x
|
||||||
#define EVP_CIPHER_nid wolfSSL_EVP_CIPHER_nid
|
#define EVP_CIPHER_nid wolfSSL_EVP_CIPHER_nid
|
||||||
|
|
||||||
|
/* Base64 encoding/decoding APIs */
|
||||||
|
#if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
|
||||||
|
#define EVP_ENCODE_CTX WOLFSSL_EVP_ENCODE_CTX
|
||||||
|
#define EVP_ENCODE_CTX_new wolfSSL_EVP_ENCODE_CTX_new
|
||||||
|
#define EVP_ENCODE_CTX_free wolfSSL_EVP_ENCODE_CTX_free
|
||||||
|
#endif /* WOLFSSL_BASE64_ENCODE || WOLFSSL_BASE64_DECODE*/
|
||||||
|
#if defined(WOLFSSL_BASE64_ENCODE)
|
||||||
|
#define EVP_EncodeInit wolfSSL_EVP_EncodeInit
|
||||||
|
#define EVP_EncodeUpdate wolfSSL_EVP_EncodeUpdate
|
||||||
|
#define EVP_EncodeFinal wolfSSL_EVP_EncodeFinal
|
||||||
|
#endif /* WOLFSSL_BASE64_ENCODE */
|
||||||
|
#if defined(WOLFSSL_BASE64_DECODE)
|
||||||
|
#define EVP_DecodeInit wolfSSL_EVP_DecodeInit
|
||||||
|
#define EVP_DecodeUpdate wolfSSL_EVP_DecodeUpdate
|
||||||
|
#define EVP_DecodeFinal wolfSSL_EVP_DecodeFinal
|
||||||
|
#endif /* WOLFSSL_BASE64_DECODE */
|
||||||
|
|
||||||
|
#define EVP_blake2b512 wolfSSL_EVP_blake2b512
|
||||||
|
#define EVP_blake2s256 wolfSSL_EVP_blake2s256
|
||||||
|
|
||||||
WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
|
WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
|
||||||
|
|
||||||
@ -935,6 +1023,6 @@ WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
|
|||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libwolfssl/openssl/objects.h>
|
#include <libs/libwolfssl/openssl/objects.h>
|
||||||
|
|
||||||
#endif /* WOLFSSL_EVP_H_ */
|
#endif /* WOLFSSL_EVP_H_ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* hmac.h
|
/* hmac.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -29,15 +29,23 @@
|
|||||||
#ifndef WOLFSSL_HMAC_H_
|
#ifndef WOLFSSL_HMAC_H_
|
||||||
#define WOLFSSL_HMAC_H_
|
#define WOLFSSL_HMAC_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_hmac.h"
|
#include "prefix_hmac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libwolfssl/openssl/evp.h>
|
#include <libs/libwolfssl/wolfcrypt/hmac.h>
|
||||||
#include <libwolfssl/openssl/opensslv.h>
|
|
||||||
#include <libwolfssl/wolfcrypt/hmac.h>
|
typedef struct WOLFSSL_HMAC_CTX {
|
||||||
|
Hmac hmac;
|
||||||
|
int type;
|
||||||
|
word32 save_ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
|
||||||
|
word32 save_opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)];
|
||||||
|
} WOLFSSL_HMAC_CTX;
|
||||||
|
|
||||||
|
#include <libs/libwolfssl/openssl/evp.h>
|
||||||
|
#include <libs/libwolfssl/openssl/opensslv.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -49,22 +57,13 @@ WOLFSSL_API unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md,
|
|||||||
const unsigned char* d, int n, unsigned char* md,
|
const unsigned char* d, int n, unsigned char* md,
|
||||||
unsigned int* md_len);
|
unsigned int* md_len);
|
||||||
|
|
||||||
|
|
||||||
typedef struct WOLFSSL_HMAC_CTX {
|
|
||||||
Hmac hmac;
|
|
||||||
int type;
|
|
||||||
word32 save_ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
|
|
||||||
word32 save_opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
} WOLFSSL_HMAC_CTX;
|
|
||||||
|
|
||||||
|
|
||||||
WOLFSSL_API WOLFSSL_HMAC_CTX* wolfSSL_HMAC_CTX_new(void);
|
WOLFSSL_API WOLFSSL_HMAC_CTX* wolfSSL_HMAC_CTX_new(void);
|
||||||
WOLFSSL_API int wolfSSL_HMAC_CTX_Init(WOLFSSL_HMAC_CTX* ctx);
|
WOLFSSL_API int wolfSSL_HMAC_CTX_Init(WOLFSSL_HMAC_CTX* ctx);
|
||||||
WOLFSSL_API int wolfSSL_HMAC_CTX_copy(WOLFSSL_HMAC_CTX* des,
|
WOLFSSL_API int wolfSSL_HMAC_CTX_copy(WOLFSSL_HMAC_CTX* des,
|
||||||
WOLFSSL_HMAC_CTX* src);
|
WOLFSSL_HMAC_CTX* src);
|
||||||
WOLFSSL_LOCAL int wolfSSL_HmacCopy(Hmac* des, Hmac* src);
|
WOLFSSL_LOCAL int wolfSSL_HmacCopy(Hmac* des, Hmac* src);
|
||||||
WOLFSSL_API int wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key,
|
WOLFSSL_API int wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key,
|
||||||
int keylen, const EVP_MD* type);
|
int keylen, const WOLFSSL_EVP_MD* type);
|
||||||
WOLFSSL_API int wolfSSL_HMAC_Init_ex(WOLFSSL_HMAC_CTX* ctx, const void* key,
|
WOLFSSL_API int wolfSSL_HMAC_Init_ex(WOLFSSL_HMAC_CTX* ctx, const void* key,
|
||||||
int keylen, const EVP_MD* type, WOLFSSL_ENGINE* e);
|
int keylen, const EVP_MD* type, WOLFSSL_ENGINE* e);
|
||||||
WOLFSSL_API int wolfSSL_HMAC_Update(WOLFSSL_HMAC_CTX* ctx,
|
WOLFSSL_API int wolfSSL_HMAC_Update(WOLFSSL_HMAC_CTX* ctx,
|
||||||
@ -75,6 +74,7 @@ WOLFSSL_API int wolfSSL_HMAC_cleanup(WOLFSSL_HMAC_CTX* ctx);
|
|||||||
WOLFSSL_API void wolfSSL_HMAC_CTX_cleanup(WOLFSSL_HMAC_CTX* ctx);
|
WOLFSSL_API void wolfSSL_HMAC_CTX_cleanup(WOLFSSL_HMAC_CTX* ctx);
|
||||||
WOLFSSL_API void wolfSSL_HMAC_CTX_free(WOLFSSL_HMAC_CTX* ctx);
|
WOLFSSL_API void wolfSSL_HMAC_CTX_free(WOLFSSL_HMAC_CTX* ctx);
|
||||||
WOLFSSL_API size_t wolfSSL_HMAC_size(const WOLFSSL_HMAC_CTX *ctx);
|
WOLFSSL_API size_t wolfSSL_HMAC_size(const WOLFSSL_HMAC_CTX *ctx);
|
||||||
|
WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_HMAC_CTX_get_md(const WOLFSSL_HMAC_CTX *ctx);
|
||||||
|
|
||||||
typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
|
typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
|
||||||
|
|
||||||
@ -92,6 +92,7 @@ typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
|
|||||||
#define HMAC_Final wolfSSL_HMAC_Final
|
#define HMAC_Final wolfSSL_HMAC_Final
|
||||||
#define HMAC_cleanup wolfSSL_HMAC_cleanup
|
#define HMAC_cleanup wolfSSL_HMAC_cleanup
|
||||||
#define HMAC_size wolfSSL_HMAC_size
|
#define HMAC_size wolfSSL_HMAC_size
|
||||||
|
#define HMAC_CTX_get_md wolfSSL_HMAC_CTX_get_md
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,2 +1,64 @@
|
|||||||
|
/* lhash.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL.
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
|
*/
|
||||||
|
|
||||||
/* lhash.h for openSSL */
|
/* lhash.h for openSSL */
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_lhash_H_
|
||||||
|
#define WOLFSSL_lhash_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
|
|
||||||
|
#ifdef OPENSSL_ALL
|
||||||
|
#define IMPLEMENT_LHASH_HASH_FN(name, type) \
|
||||||
|
unsigned long wolfSSL_##name##_LHASH_HASH(const void *arg) \
|
||||||
|
{ \
|
||||||
|
const type *a = arg; \
|
||||||
|
return name##_hash(a); \
|
||||||
|
}
|
||||||
|
#define IMPLEMENT_LHASH_COMP_FN(name, type) \
|
||||||
|
int wolfSSL_##name##_LHASH_COMP(const void *p1, const void *p2) \
|
||||||
|
{ \
|
||||||
|
const type *_p1 = p1; \
|
||||||
|
const type *_p2 = p2; \
|
||||||
|
return name##_cmp(_p1, _p2); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LHASH_HASH_FN(name) wolfSSL_##name##_LHASH_HASH
|
||||||
|
#define LHASH_COMP_FN(name) wolfSSL_##name##_LHASH_COMP
|
||||||
|
|
||||||
|
WOLFSSL_API unsigned long wolfSSL_LH_strhash(const char *str);
|
||||||
|
|
||||||
|
WOLFSSL_API void *wolfSSL_lh_retrieve(WOLFSSL_STACK *sk, void *data);
|
||||||
|
|
||||||
|
#define lh_strhash wolfSSL_LH_strhash
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* WOLFSSL_lhash_H_ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* md4.h
|
/* md4.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -23,7 +23,7 @@
|
|||||||
#ifndef WOLFSSL_MD4_H_
|
#ifndef WOLFSSL_MD4_H_
|
||||||
#define WOLFSSL_MD4_H_
|
#define WOLFSSL_MD4_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifndef NO_MD4
|
#ifndef NO_MD4
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* md5.h
|
/* md5.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,11 +25,11 @@
|
|||||||
#ifndef WOLFSSL_MD5_H_
|
#ifndef WOLFSSL_MD5_H_
|
||||||
#define WOLFSSL_MD5_H_
|
#define WOLFSSL_MD5_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/hash.h>
|
#include <libs/libwolfssl/wolfcrypt/hash.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_md5.h"
|
#include "prefix_md5.h"
|
||||||
@ -52,13 +52,14 @@ typedef struct WOLFSSL_MD5_CTX {
|
|||||||
WOLFSSL_API int wolfSSL_MD5_Init(WOLFSSL_MD5_CTX*);
|
WOLFSSL_API int wolfSSL_MD5_Init(WOLFSSL_MD5_CTX*);
|
||||||
WOLFSSL_API int wolfSSL_MD5_Update(WOLFSSL_MD5_CTX*, const void*, unsigned long);
|
WOLFSSL_API int wolfSSL_MD5_Update(WOLFSSL_MD5_CTX*, const void*, unsigned long);
|
||||||
WOLFSSL_API int wolfSSL_MD5_Final(unsigned char*, WOLFSSL_MD5_CTX*);
|
WOLFSSL_API int wolfSSL_MD5_Final(unsigned char*, WOLFSSL_MD5_CTX*);
|
||||||
|
WOLFSSL_API int wolfSSL_MD5_Transform(WOLFSSL_MD5_CTX*, const unsigned char*);
|
||||||
|
|
||||||
typedef WOLFSSL_MD5_CTX MD5_CTX;
|
typedef WOLFSSL_MD5_CTX MD5_CTX;
|
||||||
|
|
||||||
#define MD5_Init wolfSSL_MD5_Init
|
#define MD5_Init wolfSSL_MD5_Init
|
||||||
#define MD5_Update wolfSSL_MD5_Update
|
#define MD5_Update wolfSSL_MD5_Update
|
||||||
#define MD5_Final wolfSSL_MD5_Final
|
#define MD5_Final wolfSSL_MD5_Final
|
||||||
|
#define MD5_Transform wolfSSL_MD5_Transform
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA_BSD
|
#ifdef OPENSSL_EXTRA_BSD
|
||||||
#define MD5Init wolfSSL_MD5_Init
|
#define MD5Init wolfSSL_MD5_Init
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* obj_mac.h
|
/* obj_mac.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2017 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -42,6 +42,8 @@
|
|||||||
#define NID_sect571k1 733
|
#define NID_sect571k1 733
|
||||||
#define NID_sect571r1 734
|
#define NID_sect571r1 734
|
||||||
|
|
||||||
|
/* the definition is for Qt Unit test */
|
||||||
|
#define SN_jurisdictionCountryName "jurisdictionC"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* objects.h
|
/* objects.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -23,11 +23,11 @@
|
|||||||
#ifndef WOLFSSL_OBJECTS_H_
|
#ifndef WOLFSSL_OBJECTS_H_
|
||||||
#define WOLFSSL_OBJECTS_H_
|
#define WOLFSSL_OBJECTS_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
//#include <libwolfssl/openssl/ssl.h>
|
//#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#ifndef OPENSSL_EXTRA_SSL_GUARD
|
#ifndef OPENSSL_EXTRA_SSL_GUARD
|
||||||
#define OPENSSL_EXTRA_SSL_GUARD
|
#define OPENSSL_EXTRA_SSL_GUARD
|
||||||
#include <libwolfssl/ssl.h>
|
#include <libs/libwolfssl/ssl.h>
|
||||||
#endif /* OPENSSL_EXTRA_SSL_GUARD */
|
#endif /* OPENSSL_EXTRA_SSL_GUARD */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ocsp.h
|
/* ocsp.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,11 +25,12 @@
|
|||||||
#define WOLFSSL_OCSP_H_
|
#define WOLFSSL_OCSP_H_
|
||||||
|
|
||||||
#ifdef HAVE_OCSP
|
#ifdef HAVE_OCSP
|
||||||
#include <libwolfssl/ocsp.h>
|
#include <libs/libwolfssl/ocsp.h>
|
||||||
|
|
||||||
#define OCSP_REQUEST OcspRequest
|
#define OCSP_REQUEST OcspRequest
|
||||||
#define OCSP_RESPONSE OcspResponse
|
#define OCSP_RESPONSE OcspResponse
|
||||||
#define OCSP_BASICRESP WOLFSSL_OCSP_BASICRESP
|
#define OCSP_BASICRESP WOLFSSL_OCSP_BASICRESP
|
||||||
|
#define OCSP_SINGLERESP WOLFSSL_OCSP_SINGLERESP
|
||||||
#define OCSP_CERTID WOLFSSL_OCSP_CERTID
|
#define OCSP_CERTID WOLFSSL_OCSP_CERTID
|
||||||
#define OCSP_ONEREQ WOLFSSL_OCSP_ONEREQ
|
#define OCSP_ONEREQ WOLFSSL_OCSP_ONEREQ
|
||||||
|
|
||||||
@ -76,6 +77,13 @@
|
|||||||
|
|
||||||
#define i2d_OCSP_REQUEST_bio wolfSSL_i2d_OCSP_REQUEST_bio
|
#define i2d_OCSP_REQUEST_bio wolfSSL_i2d_OCSP_REQUEST_bio
|
||||||
|
|
||||||
|
#define i2d_OCSP_CERTID wolfSSL_i2d_OCSP_CERTID
|
||||||
|
#define OCSP_SINGLERESP_get0_id wolfSSL_OCSP_SINGLERESP_get0_id
|
||||||
|
#define OCSP_id_cmp wolfSSL_OCSP_id_cmp
|
||||||
|
#define OCSP_single_get0_status wolfSSL_OCSP_single_get0_status
|
||||||
|
#define OCSP_resp_count wolfSSL_OCSP_resp_count
|
||||||
|
#define OCSP_resp_get0 wolfSSL_OCSP_resp_get0
|
||||||
|
|
||||||
#endif /* HAVE_OCSP */
|
#endif /* HAVE_OCSP */
|
||||||
|
|
||||||
#endif /* WOLFSSL_OCSP_H_ */
|
#endif /* WOLFSSL_OCSP_H_ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* opensslv.h
|
/* opensslv.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -26,12 +26,19 @@
|
|||||||
|
|
||||||
|
|
||||||
/* api version compatibility */
|
/* api version compatibility */
|
||||||
#if defined(WOLFSSL_APACHE_HTTPD)
|
#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x0090810fL) ||\
|
||||||
|
defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10100000L) ||\
|
||||||
|
defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10001040L)
|
||||||
|
/* valid version */
|
||||||
|
#elif defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIBEST) || defined(WOLFSSL_BIND)
|
||||||
/* For Apache httpd, Use 1.1.0 compatibility */
|
/* For Apache httpd, Use 1.1.0 compatibility */
|
||||||
#define OPENSSL_VERSION_NUMBER 0x10100000L
|
#define OPENSSL_VERSION_NUMBER 0x10100000L
|
||||||
|
#elif defined(WOLFSSL_QT)
|
||||||
|
#define OPENSSL_VERSION_NUMBER 0x10101000L
|
||||||
|
#elif defined(WOLFSSL_HAPROXY)
|
||||||
|
#define OPENSSL_VERSION_NUMBER 0x1010000fL
|
||||||
#elif defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) || \
|
#elif defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) || \
|
||||||
defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
defined(WOLFSSL_NGINX) || defined(WOLFSSL_OPENSSH) || defined(WOLFSSL_OPENVPN)
|
||||||
defined(WOLFSSL_OPENSSH) || defined(WOLFSSL_QT) || defined(WOLFSSL_OPENVPN)
|
|
||||||
/* version number can be increased for Lighty after compatibility for ECDH
|
/* version number can be increased for Lighty after compatibility for ECDH
|
||||||
is added */
|
is added */
|
||||||
#define OPENSSL_VERSION_NUMBER 0x10001040L
|
#define OPENSSL_VERSION_NUMBER 0x10001040L
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ossl_typ.h
|
/* ossl_typ.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -27,6 +27,6 @@
|
|||||||
#ifndef WOLFSSL_OSSL_TYP_H_
|
#ifndef WOLFSSL_OSSL_TYP_H_
|
||||||
#define WOLFSSL_OSSL_TYP_H_
|
#define WOLFSSL_OSSL_TYP_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
|
|
||||||
#endif /* !WOLFSSL_OSSL_TYP_H_ */
|
#endif /* !WOLFSSL_OSSL_TYP_H_ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* pem.h
|
/* pem.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -29,11 +29,11 @@
|
|||||||
#ifndef WOLFSSL_PEM_H_
|
#ifndef WOLFSSL_PEM_H_
|
||||||
#define WOLFSSL_PEM_H_
|
#define WOLFSSL_PEM_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/evp.h>
|
#include <libs/libwolfssl/openssl/evp.h>
|
||||||
#include <libwolfssl/openssl/bio.h>
|
#include <libs/libwolfssl/openssl/bio.h>
|
||||||
#include <libwolfssl/openssl/rsa.h>
|
#include <libs/libwolfssl/openssl/rsa.h>
|
||||||
#include <libwolfssl/openssl/dsa.h>
|
#include <libs/libwolfssl/openssl/dsa.h>
|
||||||
#include <libwolfssl/ssl.h>
|
#include <libs/libwolfssl/ssl.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -242,6 +242,9 @@ int wolfSSL_PEM_write_DHparams(XFILE fp, WOLFSSL_DH* dh);
|
|||||||
#define PEM_write_ECPrivateKey wolfSSL_PEM_write_ECPrivateKey
|
#define PEM_write_ECPrivateKey wolfSSL_PEM_write_ECPrivateKey
|
||||||
#define PEM_read_bio_ECPrivateKey wolfSSL_PEM_read_bio_ECPrivateKey
|
#define PEM_read_bio_ECPrivateKey wolfSSL_PEM_read_bio_ECPrivateKey
|
||||||
#define PEM_read_bio_EC_PUBKEY wolfSSL_PEM_read_bio_EC_PUBKEY
|
#define PEM_read_bio_EC_PUBKEY wolfSSL_PEM_read_bio_EC_PUBKEY
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define PEM_write_bio_ECPKParameters(...) 0
|
||||||
|
#endif
|
||||||
/* EVP_KEY */
|
/* EVP_KEY */
|
||||||
#define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey
|
#define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey
|
||||||
#define PEM_read_PUBKEY wolfSSL_PEM_read_PUBKEY
|
#define PEM_read_PUBKEY wolfSSL_PEM_read_PUBKEY
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* pkcs12.h
|
/* pkcs12.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -22,8 +22,8 @@
|
|||||||
/* pkcs12.h for openssl */
|
/* pkcs12.h for openssl */
|
||||||
|
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#include <libwolfssl/wolfcrypt/pkcs12.h>
|
#include <libs/libwolfssl/wolfcrypt/pkcs12.h>
|
||||||
|
|
||||||
#ifndef WOLFSSL_PKCS12_COMPAT_H_
|
#ifndef WOLFSSL_PKCS12_COMPAT_H_
|
||||||
#define WOLFSSL_PKCS12_COMPAT_H_
|
#define WOLFSSL_PKCS12_COMPAT_H_
|
||||||
@ -42,6 +42,7 @@
|
|||||||
/* wolfSSL level using structs from ssl.h and calls down to wolfCrypt */
|
/* wolfSSL level using structs from ssl.h and calls down to wolfCrypt */
|
||||||
#define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
|
#define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
|
||||||
#define PKCS12_parse wolfSSL_PKCS12_parse
|
#define PKCS12_parse wolfSSL_PKCS12_parse
|
||||||
|
#define PKCS12_verify_mac wolfSSL_PKCS12_verify_mac
|
||||||
#define PKCS12_create wolfSSL_PKCS12_create
|
#define PKCS12_create wolfSSL_PKCS12_create
|
||||||
#define PKCS12_PBE_add wolfSSL_PKCS12_PBE_add
|
#define PKCS12_PBE_add wolfSSL_PKCS12_PBE_add
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* pkcs7.h
|
/* pkcs7.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,8 +25,8 @@
|
|||||||
#ifndef WOLFSSL_PKCS7_H_
|
#ifndef WOLFSSL_PKCS7_H_
|
||||||
#define WOLFSSL_PKCS7_H_
|
#define WOLFSSL_PKCS7_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#include <libwolfssl/wolfcrypt/pkcs7.h>
|
#include <libs/libwolfssl/wolfcrypt/pkcs7.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -37,12 +37,12 @@
|
|||||||
#define PKCS7_NOINTERN 0x0010
|
#define PKCS7_NOINTERN 0x0010
|
||||||
#define PKCS7_NOVERIFY 0x0020
|
#define PKCS7_NOVERIFY 0x0020
|
||||||
|
|
||||||
|
|
||||||
typedef struct WOLFSSL_PKCS7
|
typedef struct WOLFSSL_PKCS7
|
||||||
{
|
{
|
||||||
PKCS7 pkcs7;
|
PKCS7 pkcs7;
|
||||||
unsigned char* data;
|
unsigned char* data;
|
||||||
int len;
|
int len;
|
||||||
|
WOLFSSL_STACK* certs;
|
||||||
} WOLFSSL_PKCS7;
|
} WOLFSSL_PKCS7;
|
||||||
|
|
||||||
|
|
||||||
@ -52,12 +52,22 @@ WOLFSSL_API void wolfSSL_PKCS7_free(PKCS7* p7);
|
|||||||
WOLFSSL_API void wolfSSL_PKCS7_SIGNED_free(PKCS7_SIGNED* p7);
|
WOLFSSL_API void wolfSSL_PKCS7_SIGNED_free(PKCS7_SIGNED* p7);
|
||||||
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7(PKCS7** p7, const unsigned char** in,
|
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7(PKCS7** p7, const unsigned char** in,
|
||||||
int len);
|
int len);
|
||||||
|
WOLFSSL_LOCAL PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in,
|
||||||
|
int len, byte* content, word32 contentSz);
|
||||||
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7);
|
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7);
|
||||||
|
WOLFSSL_API int wolfSSL_i2d_PKCS7_bio(WOLFSSL_BIO *bio, PKCS7 *p7);
|
||||||
WOLFSSL_API int wolfSSL_PKCS7_verify(PKCS7* p7, WOLFSSL_STACK* certs,
|
WOLFSSL_API int wolfSSL_PKCS7_verify(PKCS7* p7, WOLFSSL_STACK* certs,
|
||||||
WOLFSSL_X509_STORE* store, WOLFSSL_BIO* in, WOLFSSL_BIO* out, int flags);
|
WOLFSSL_X509_STORE* store, WOLFSSL_BIO* in, WOLFSSL_BIO* out, int flags);
|
||||||
|
WOLFSSL_API int wolfSSL_PKCS7_encode_certs(PKCS7* p7, WOLFSSL_STACK* certs,
|
||||||
|
WOLFSSL_BIO* out);
|
||||||
|
WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_to_stack(PKCS7* pkcs7);
|
||||||
WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_get0_signers(PKCS7* p7,
|
WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_get0_signers(PKCS7* p7,
|
||||||
WOLFSSL_STACK* certs, int flags);
|
WOLFSSL_STACK* certs, int flags);
|
||||||
WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
|
WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
|
||||||
|
#if defined(HAVE_SMIME)
|
||||||
|
WOLFSSL_API PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in, WOLFSSL_BIO** bcont);
|
||||||
|
#endif /* HAVE_SMIME */
|
||||||
|
|
||||||
|
|
||||||
#define PKCS7_new wolfSSL_PKCS7_new
|
#define PKCS7_new wolfSSL_PKCS7_new
|
||||||
#define PKCS7_SIGNED_new wolfSSL_PKCS7_SIGNED_new
|
#define PKCS7_SIGNED_new wolfSSL_PKCS7_SIGNED_new
|
||||||
@ -65,9 +75,13 @@ WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
|
|||||||
#define PKCS7_SIGNED_free wolfSSL_PKCS7_SIGNED_free
|
#define PKCS7_SIGNED_free wolfSSL_PKCS7_SIGNED_free
|
||||||
#define d2i_PKCS7 wolfSSL_d2i_PKCS7
|
#define d2i_PKCS7 wolfSSL_d2i_PKCS7
|
||||||
#define d2i_PKCS7_bio wolfSSL_d2i_PKCS7_bio
|
#define d2i_PKCS7_bio wolfSSL_d2i_PKCS7_bio
|
||||||
|
#define i2d_PKCS7_bio wolfSSL_i2d_PKCS7_bio
|
||||||
#define PKCS7_verify wolfSSL_PKCS7_verify
|
#define PKCS7_verify wolfSSL_PKCS7_verify
|
||||||
#define PKCS7_get0_signers wolfSSL_PKCS7_get0_signers
|
#define PKCS7_get0_signers wolfSSL_PKCS7_get0_signers
|
||||||
#define PEM_write_bio_PKCS7 wolfSSL_PEM_write_bio_PKCS7
|
#define PEM_write_bio_PKCS7 wolfSSL_PEM_write_bio_PKCS7
|
||||||
|
#if defined(HAVE_SMIME)
|
||||||
|
#define SMIME_read_PKCS7 wolfSSL_SMIME_read_PKCS7
|
||||||
|
#endif /* HAVE_SMIME */
|
||||||
|
|
||||||
#endif /* OPENSSL_ALL && HAVE_PKCS7 */
|
#endif /* OPENSSL_ALL && HAVE_PKCS7 */
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* rand.h
|
/* rand.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
/* rand.h for openSSL */
|
/* rand.h for openSSL */
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#include <libwolfssl/wolfcrypt/random.h>
|
#include <libs/libwolfssl/wolfcrypt/random.h>
|
||||||
|
|
||||||
|
typedef WOLFSSL_RAND_METHOD RAND_METHOD;
|
||||||
|
|
||||||
#define RAND_set_rand_method wolfSSL_RAND_set_rand_method
|
#define RAND_set_rand_method wolfSSL_RAND_set_rand_method
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* rc4.h
|
/* rc4.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -28,8 +28,8 @@
|
|||||||
#ifndef WOLFSSL_RC4_COMPAT_H_
|
#ifndef WOLFSSL_RC4_COMPAT_H_
|
||||||
#define WOLFSSL_RC4_COMPAT_H_
|
#define WOLFSSL_RC4_COMPAT_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
#include <libwolfssl/openssl/ssl.h> /* included for size_t */
|
#include <libs/libwolfssl/openssl/ssl.h> /* included for size_t */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ripemd.h
|
/* ripemd.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#ifndef WOLFSSL_RIPEMD_H_
|
#ifndef WOLFSSL_RIPEMD_H_
|
||||||
#define WOLFSSL_RIPEMD_H_
|
#define WOLFSSL_RIPEMD_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* rsa.h
|
/* rsa.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,9 +25,9 @@
|
|||||||
#ifndef WOLFSSL_RSA_H_
|
#ifndef WOLFSSL_RSA_H_
|
||||||
#define WOLFSSL_RSA_H_
|
#define WOLFSSL_RSA_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/bn.h>
|
#include <libs/libwolfssl/openssl/bn.h>
|
||||||
#include <libwolfssl/openssl/err.h>
|
#include <libs/libwolfssl/openssl/err.h>
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -77,19 +77,22 @@ typedef struct WOLFSSL_RSA {
|
|||||||
WOLFSSL_BIGNUM* iqmp; /* u */
|
WOLFSSL_BIGNUM* iqmp; /* u */
|
||||||
void* heap;
|
void* heap;
|
||||||
void* internal; /* our RSA */
|
void* internal; /* our RSA */
|
||||||
char inSet; /* internal set from external ? */
|
|
||||||
char exSet; /* external set from internal ? */
|
|
||||||
char ownRng; /* flag for if the rng should be free'd */
|
|
||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
WOLFSSL_RSA_METHOD* meth;
|
WOLFSSL_RSA_METHOD* meth;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_EX_DATA)
|
#if defined(HAVE_EX_DATA)
|
||||||
WOLFSSL_CRYPTO_EX_DATA ex_data; /* external data */
|
WOLFSSL_CRYPTO_EX_DATA ex_data; /* external data */
|
||||||
#endif
|
#endif
|
||||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)
|
#if defined(OPENSSL_EXTRA_X509_SMALL) || defined(OPENSSL_EXTRA)
|
||||||
wolfSSL_Mutex refMutex; /* ref count mutex */
|
wolfSSL_Mutex refMutex; /* ref count mutex */
|
||||||
int refCount; /* reference count */
|
int refCount; /* reference count */
|
||||||
#endif
|
#endif
|
||||||
|
word16 pkcs8HeaderSz;
|
||||||
|
|
||||||
|
/* bits */
|
||||||
|
byte inSet:1; /* internal set from external ? */
|
||||||
|
byte exSet:1; /* external set from internal ? */
|
||||||
|
byte ownRng:1; /* flag for if the rng should be free'd */
|
||||||
} WOLFSSL_RSA;
|
} WOLFSSL_RSA;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -107,19 +110,27 @@ WOLFSSL_API int wolfSSL_RSA_public_encrypt(int len, const unsigned char* fr,
|
|||||||
unsigned char* to, WOLFSSL_RSA*, int padding);
|
unsigned char* to, WOLFSSL_RSA*, int padding);
|
||||||
WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr,
|
WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr,
|
||||||
unsigned char* to, WOLFSSL_RSA*, int padding);
|
unsigned char* to, WOLFSSL_RSA*, int padding);
|
||||||
WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, unsigned char* in,
|
WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, const unsigned char* in,
|
||||||
unsigned char* out, WOLFSSL_RSA* rsa, int padding);
|
unsigned char* out, WOLFSSL_RSA* rsa, int padding);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);
|
WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_bits(const WOLFSSL_RSA*);
|
||||||
WOLFSSL_API int wolfSSL_RSA_sign(int type, const unsigned char* m,
|
WOLFSSL_API int wolfSSL_RSA_sign(int type, const unsigned char* m,
|
||||||
unsigned int mLen, unsigned char* sigRet,
|
unsigned int mLen, unsigned char* sigRet,
|
||||||
unsigned int* sigLen, WOLFSSL_RSA*);
|
unsigned int* sigLen, WOLFSSL_RSA*);
|
||||||
WOLFSSL_API int wolfSSL_RSA_sign_ex(int type, const unsigned char* m,
|
WOLFSSL_API int wolfSSL_RSA_sign_ex(int type, const unsigned char* m,
|
||||||
unsigned int mLen, unsigned char* sigRet,
|
unsigned int mLen, unsigned char* sigRet,
|
||||||
unsigned int* sigLen, WOLFSSL_RSA*, int);
|
unsigned int* sigLen, WOLFSSL_RSA*, int);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_sign_generic_padding(int type, const unsigned char* m,
|
||||||
|
unsigned int mLen, unsigned char* sigRet,
|
||||||
|
unsigned int* sigLen, WOLFSSL_RSA*, int, int);
|
||||||
WOLFSSL_API int wolfSSL_RSA_verify(int type, const unsigned char* m,
|
WOLFSSL_API int wolfSSL_RSA_verify(int type, const unsigned char* m,
|
||||||
unsigned int mLen, const unsigned char* sig,
|
unsigned int mLen, const unsigned char* sig,
|
||||||
unsigned int sigLen, WOLFSSL_RSA*);
|
unsigned int sigLen, WOLFSSL_RSA*);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_verify_ex(int type, const unsigned char* m,
|
||||||
|
unsigned int mLen, const unsigned char* sig,
|
||||||
|
unsigned int sigLen, WOLFSSL_RSA* rsa,
|
||||||
|
int padding);
|
||||||
WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from,
|
WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from,
|
||||||
unsigned char* to, WOLFSSL_RSA*, int padding);
|
unsigned char* to, WOLFSSL_RSA*, int padding);
|
||||||
WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*);
|
WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*);
|
||||||
@ -133,18 +144,35 @@ WOLFSSL_API int wolfSSL_RSA_set_method(WOLFSSL_RSA *rsa, WOLFSSL_RSA_METHOD *met
|
|||||||
WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_method(const WOLFSSL_RSA *rsa);
|
WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_method(const WOLFSSL_RSA *rsa);
|
||||||
WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_default_method(void);
|
WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_default_method(void);
|
||||||
|
|
||||||
|
WOLFSSL_API void wolfSSL_RSA_get0_crt_params(const WOLFSSL_RSA *r,
|
||||||
|
const WOLFSSL_BIGNUM **dmp1,
|
||||||
|
const WOLFSSL_BIGNUM **dmq1,
|
||||||
|
const WOLFSSL_BIGNUM **iqmp);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_set0_crt_params(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *dmp1,
|
||||||
|
WOLFSSL_BIGNUM *dmq1, WOLFSSL_BIGNUM *iqmp);
|
||||||
|
WOLFSSL_API void wolfSSL_RSA_get0_factors(const WOLFSSL_RSA *r, const WOLFSSL_BIGNUM **p,
|
||||||
|
const WOLFSSL_BIGNUM **q);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_set0_factors(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *p, WOLFSSL_BIGNUM *q);
|
||||||
WOLFSSL_API void wolfSSL_RSA_get0_key(const WOLFSSL_RSA *r, const WOLFSSL_BIGNUM **n,
|
WOLFSSL_API void wolfSSL_RSA_get0_key(const WOLFSSL_RSA *r, const WOLFSSL_BIGNUM **n,
|
||||||
const WOLFSSL_BIGNUM **e, const WOLFSSL_BIGNUM **d);
|
const WOLFSSL_BIGNUM **e, const WOLFSSL_BIGNUM **d);
|
||||||
WOLFSSL_API int wolfSSL_RSA_set0_key(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *n, WOLFSSL_BIGNUM *e,
|
WOLFSSL_API int wolfSSL_RSA_set0_key(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *n, WOLFSSL_BIGNUM *e,
|
||||||
WOLFSSL_BIGNUM *d);
|
WOLFSSL_BIGNUM *d);
|
||||||
WOLFSSL_API int wolfSSL_RSA_flags(const WOLFSSL_RSA *r);
|
WOLFSSL_API int wolfSSL_RSA_flags(const WOLFSSL_RSA *r);
|
||||||
WOLFSSL_API void wolfSSL_RSA_set_flags(WOLFSSL_RSA *r, int flags);
|
WOLFSSL_API void wolfSSL_RSA_set_flags(WOLFSSL_RSA *r, int flags);
|
||||||
|
WOLFSSL_API void wolfSSL_RSA_clear_flags(WOLFSSL_RSA *r, int flags);
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_test_flags(const WOLFSSL_RSA *r, int flags);
|
||||||
|
|
||||||
WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSAPublicKey_dup(WOLFSSL_RSA *rsa);
|
WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSAPublicKey_dup(WOLFSSL_RSA *rsa);
|
||||||
|
|
||||||
WOLFSSL_API void* wolfSSL_RSA_get_ex_data(const WOLFSSL_RSA *rsa, int idx);
|
WOLFSSL_API void* wolfSSL_RSA_get_ex_data(const WOLFSSL_RSA *rsa, int idx);
|
||||||
WOLFSSL_API int wolfSSL_RSA_set_ex_data(WOLFSSL_RSA *rsa, int idx, void *data);
|
WOLFSSL_API int wolfSSL_RSA_set_ex_data(WOLFSSL_RSA *rsa, int idx, void *data);
|
||||||
|
#ifdef HAVE_EX_DATA_CLEANUP_HOOKS
|
||||||
|
WOLFSSL_API int wolfSSL_RSA_set_ex_data_with_cleanup(
|
||||||
|
WOLFSSL_RSA *rsa,
|
||||||
|
int idx,
|
||||||
|
void *data,
|
||||||
|
wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define WOLFSSL_RSA_LOAD_PRIVATE 1
|
#define WOLFSSL_RSA_LOAD_PRIVATE 1
|
||||||
#define WOLFSSL_RSA_LOAD_PUBLIC 2
|
#define WOLFSSL_RSA_LOAD_PUBLIC 2
|
||||||
@ -177,10 +205,16 @@ WOLFSSL_API int wolfSSL_RSA_set_ex_data(WOLFSSL_RSA *rsa, int idx, void *data);
|
|||||||
#define RSA_get_default_method wolfSSL_RSA_get_default_method
|
#define RSA_get_default_method wolfSSL_RSA_get_default_method
|
||||||
#define RSA_get_method wolfSSL_RSA_get_method
|
#define RSA_get_method wolfSSL_RSA_get_method
|
||||||
#define RSA_set_method wolfSSL_RSA_set_method
|
#define RSA_set_method wolfSSL_RSA_set_method
|
||||||
|
#define RSA_get0_crt_params wolfSSL_RSA_get0_crt_params
|
||||||
|
#define RSA_set0_crt_params wolfSSL_RSA_set0_crt_params
|
||||||
|
#define RSA_get0_factors wolfSSL_RSA_get0_factors
|
||||||
|
#define RSA_set0_factors wolfSSL_RSA_set0_factors
|
||||||
#define RSA_get0_key wolfSSL_RSA_get0_key
|
#define RSA_get0_key wolfSSL_RSA_get0_key
|
||||||
#define RSA_set0_key wolfSSL_RSA_set0_key
|
#define RSA_set0_key wolfSSL_RSA_set0_key
|
||||||
#define RSA_flags wolfSSL_RSA_flags
|
#define RSA_flags wolfSSL_RSA_flags
|
||||||
#define RSA_set_flags wolfSSL_RSA_set_flags
|
#define RSA_set_flags wolfSSL_RSA_set_flags
|
||||||
|
#define RSA_clear_flags wolfSSL_RSA_clear_flags
|
||||||
|
#define RSA_test_flags wolfSSL_RSA_test_flags
|
||||||
|
|
||||||
#define RSAPublicKey_dup wolfSSL_RSAPublicKey_dup
|
#define RSAPublicKey_dup wolfSSL_RSAPublicKey_dup
|
||||||
#define RSA_get_ex_data wolfSSL_RSA_get_ex_data
|
#define RSA_get_ex_data wolfSSL_RSA_get_ex_data
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* sha.h
|
/* sha.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,8 +25,8 @@
|
|||||||
#ifndef WOLFSSL_SHA_H_
|
#ifndef WOLFSSL_SHA_H_
|
||||||
#define WOLFSSL_SHA_H_
|
#define WOLFSSL_SHA_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_sha.h"
|
#include "prefix_sha.h"
|
||||||
@ -52,12 +52,14 @@ typedef struct WOLFSSL_SHA_CTX {
|
|||||||
WOLFSSL_API int wolfSSL_SHA_Init(WOLFSSL_SHA_CTX*);
|
WOLFSSL_API int wolfSSL_SHA_Init(WOLFSSL_SHA_CTX*);
|
||||||
WOLFSSL_API int wolfSSL_SHA_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
|
WOLFSSL_API int wolfSSL_SHA_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
|
||||||
WOLFSSL_API int wolfSSL_SHA_Final(unsigned char*, WOLFSSL_SHA_CTX*);
|
WOLFSSL_API int wolfSSL_SHA_Final(unsigned char*, WOLFSSL_SHA_CTX*);
|
||||||
|
WOLFSSL_API int wolfSSL_SHA_Transform(WOLFSSL_SHA_CTX*,
|
||||||
|
const unsigned char *data);
|
||||||
/* SHA1 points to above, shouldn't use SHA0 ever */
|
/* SHA1 points to above, shouldn't use SHA0 ever */
|
||||||
WOLFSSL_API int wolfSSL_SHA1_Init(WOLFSSL_SHA_CTX*);
|
WOLFSSL_API int wolfSSL_SHA1_Init(WOLFSSL_SHA_CTX*);
|
||||||
WOLFSSL_API int wolfSSL_SHA1_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
|
WOLFSSL_API int wolfSSL_SHA1_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
|
||||||
WOLFSSL_API int wolfSSL_SHA1_Final(unsigned char*, WOLFSSL_SHA_CTX*);
|
WOLFSSL_API int wolfSSL_SHA1_Final(unsigned char*, WOLFSSL_SHA_CTX*);
|
||||||
|
WOLFSSL_API int wolfSSL_SHA1_Transform(WOLFSSL_SHA_CTX*,
|
||||||
|
const unsigned char *data);
|
||||||
enum {
|
enum {
|
||||||
SHA_DIGEST_LENGTH = 20
|
SHA_DIGEST_LENGTH = 20
|
||||||
};
|
};
|
||||||
@ -68,11 +70,20 @@ typedef WOLFSSL_SHA_CTX SHA_CTX;
|
|||||||
#define SHA_Init wolfSSL_SHA_Init
|
#define SHA_Init wolfSSL_SHA_Init
|
||||||
#define SHA_Update wolfSSL_SHA_Update
|
#define SHA_Update wolfSSL_SHA_Update
|
||||||
#define SHA_Final wolfSSL_SHA_Final
|
#define SHA_Final wolfSSL_SHA_Final
|
||||||
|
#define SHA_Transform wolfSSL_SHA_Transform
|
||||||
|
|
||||||
|
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_SELFTEST) && \
|
||||||
|
(!defined(HAVE_FIPS) || \
|
||||||
|
(defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2))
|
||||||
|
/* SHA is only available in non-fips mode or fips version > 2 mode
|
||||||
|
* because of SHA enum in FIPS build. */
|
||||||
|
#define SHA wolfSSL_SHA1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SHA1_Init wolfSSL_SHA1_Init
|
#define SHA1_Init wolfSSL_SHA1_Init
|
||||||
#define SHA1_Update wolfSSL_SHA1_Update
|
#define SHA1_Update wolfSSL_SHA1_Update
|
||||||
#define SHA1_Final wolfSSL_SHA1_Final
|
#define SHA1_Final wolfSSL_SHA1_Final
|
||||||
|
#define SHA1_Transform wolfSSL_SHA1_Transform
|
||||||
|
|
||||||
#ifdef WOLFSSL_SHA224
|
#ifdef WOLFSSL_SHA224
|
||||||
|
|
||||||
@ -99,6 +110,13 @@ typedef WOLFSSL_SHA224_CTX SHA224_CTX;
|
|||||||
#define SHA224_Init wolfSSL_SHA224_Init
|
#define SHA224_Init wolfSSL_SHA224_Init
|
||||||
#define SHA224_Update wolfSSL_SHA224_Update
|
#define SHA224_Update wolfSSL_SHA224_Update
|
||||||
#define SHA224_Final wolfSSL_SHA224_Final
|
#define SHA224_Final wolfSSL_SHA224_Final
|
||||||
|
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_SELFTEST) && \
|
||||||
|
(!defined(HAVE_FIPS) || \
|
||||||
|
(defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2))
|
||||||
|
/* SHA224 is only available in non-fips mode or fips version > 2 mode
|
||||||
|
* because of SHA224 enum in FIPS build. */
|
||||||
|
#define SHA224 wolfSSL_SHA224
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* WOLFSSL_SHA224 */
|
#endif /* WOLFSSL_SHA224 */
|
||||||
|
|
||||||
@ -113,9 +131,10 @@ typedef struct WOLFSSL_SHA256_CTX {
|
|||||||
|
|
||||||
WOLFSSL_API int wolfSSL_SHA256_Init(WOLFSSL_SHA256_CTX*);
|
WOLFSSL_API int wolfSSL_SHA256_Init(WOLFSSL_SHA256_CTX*);
|
||||||
WOLFSSL_API int wolfSSL_SHA256_Update(WOLFSSL_SHA256_CTX*, const void*,
|
WOLFSSL_API int wolfSSL_SHA256_Update(WOLFSSL_SHA256_CTX*, const void*,
|
||||||
unsigned long);
|
unsigned long);
|
||||||
WOLFSSL_API int wolfSSL_SHA256_Final(unsigned char*, WOLFSSL_SHA256_CTX*);
|
WOLFSSL_API int wolfSSL_SHA256_Final(unsigned char*, WOLFSSL_SHA256_CTX*);
|
||||||
|
WOLFSSL_API int wolfSSL_SHA256_Transform(WOLFSSL_SHA256_CTX*,
|
||||||
|
const unsigned char *data);
|
||||||
enum {
|
enum {
|
||||||
SHA256_DIGEST_LENGTH = 32
|
SHA256_DIGEST_LENGTH = 32
|
||||||
};
|
};
|
||||||
@ -126,6 +145,8 @@ typedef WOLFSSL_SHA256_CTX SHA256_CTX;
|
|||||||
#define SHA256_Init wolfSSL_SHA256_Init
|
#define SHA256_Init wolfSSL_SHA256_Init
|
||||||
#define SHA256_Update wolfSSL_SHA256_Update
|
#define SHA256_Update wolfSSL_SHA256_Update
|
||||||
#define SHA256_Final wolfSSL_SHA256_Final
|
#define SHA256_Final wolfSSL_SHA256_Final
|
||||||
|
#define SHA256_Transform wolfSSL_SHA256_Transform
|
||||||
|
|
||||||
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
|
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
|
||||||
/* SHA256 is only available in non-fips mode because of SHA256 enum in FIPS
|
/* SHA256 is only available in non-fips mode because of SHA256 enum in FIPS
|
||||||
* build. */
|
* build. */
|
||||||
@ -137,7 +158,7 @@ typedef WOLFSSL_SHA256_CTX SHA256_CTX;
|
|||||||
|
|
||||||
typedef struct WOLFSSL_SHA384_CTX {
|
typedef struct WOLFSSL_SHA384_CTX {
|
||||||
/* big enough to hold wolfCrypt Sha384, but check on init */
|
/* big enough to hold wolfCrypt Sha384, but check on init */
|
||||||
void* holder[(256 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
|
void* holder[(268 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
|
||||||
} WOLFSSL_SHA384_CTX;
|
} WOLFSSL_SHA384_CTX;
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_SHA384_Init(WOLFSSL_SHA384_CTX*);
|
WOLFSSL_API int wolfSSL_SHA384_Init(WOLFSSL_SHA384_CTX*);
|
||||||
@ -171,9 +192,10 @@ typedef struct WOLFSSL_SHA512_CTX {
|
|||||||
|
|
||||||
WOLFSSL_API int wolfSSL_SHA512_Init(WOLFSSL_SHA512_CTX*);
|
WOLFSSL_API int wolfSSL_SHA512_Init(WOLFSSL_SHA512_CTX*);
|
||||||
WOLFSSL_API int wolfSSL_SHA512_Update(WOLFSSL_SHA512_CTX*, const void*,
|
WOLFSSL_API int wolfSSL_SHA512_Update(WOLFSSL_SHA512_CTX*, const void*,
|
||||||
unsigned long);
|
unsigned long);
|
||||||
WOLFSSL_API int wolfSSL_SHA512_Final(unsigned char*, WOLFSSL_SHA512_CTX*);
|
WOLFSSL_API int wolfSSL_SHA512_Final(unsigned char*, WOLFSSL_SHA512_CTX*);
|
||||||
|
WOLFSSL_API int wolfSSL_SHA512_Transform(WOLFSSL_SHA512_CTX*,
|
||||||
|
const unsigned char*);
|
||||||
enum {
|
enum {
|
||||||
SHA512_DIGEST_LENGTH = 64
|
SHA512_DIGEST_LENGTH = 64
|
||||||
};
|
};
|
||||||
@ -184,6 +206,7 @@ typedef WOLFSSL_SHA512_CTX SHA512_CTX;
|
|||||||
#define SHA512_Init wolfSSL_SHA512_Init
|
#define SHA512_Init wolfSSL_SHA512_Init
|
||||||
#define SHA512_Update wolfSSL_SHA512_Update
|
#define SHA512_Update wolfSSL_SHA512_Update
|
||||||
#define SHA512_Final wolfSSL_SHA512_Final
|
#define SHA512_Final wolfSSL_SHA512_Final
|
||||||
|
#define SHA512_Transform wolfSSL_SHA512_Transform
|
||||||
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
|
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
|
||||||
/* SHA512 is only available in non-fips mode because of SHA512 enum in FIPS
|
/* SHA512 is only available in non-fips mode because of SHA512 enum in FIPS
|
||||||
* build. */
|
* build. */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* sha3.h
|
/* sha3.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -25,8 +25,8 @@
|
|||||||
#ifndef WOLFSSL_SHA3_H_
|
#ifndef WOLFSSL_SHA3_H_
|
||||||
#define WOLFSSL_SHA3_H_
|
#define WOLFSSL_SHA3_H_
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_PREFIX
|
#ifdef WOLFSSL_PREFIX
|
||||||
#include "prefix_sha.h"
|
#include "prefix_sha.h"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* ssl.h
|
/* ssl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -32,26 +32,28 @@
|
|||||||
/* wolfssl_openssl compatibility layer */
|
/* wolfssl_openssl compatibility layer */
|
||||||
#ifndef OPENSSL_EXTRA_SSL_GUARD
|
#ifndef OPENSSL_EXTRA_SSL_GUARD
|
||||||
#define OPENSSL_EXTRA_SSL_GUARD
|
#define OPENSSL_EXTRA_SSL_GUARD
|
||||||
#include <libwolfssl/ssl.h>
|
#include <libs/libwolfssl/ssl.h>
|
||||||
#endif /* OPENSSL_EXTRA_SSL_GUARD */
|
#endif /* OPENSSL_EXTRA_SSL_GUARD */
|
||||||
|
|
||||||
#include <libwolfssl/openssl/tls1.h>
|
#include <libs/libwolfssl/openssl/tls1.h>
|
||||||
#include <libwolfssl/openssl/evp.h>
|
#include <libs/libwolfssl/openssl/evp.h>
|
||||||
#include <libwolfssl/openssl/bio.h>
|
#include <libs/libwolfssl/openssl/bio.h>
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
#include <libwolfssl/openssl/crypto.h>
|
#include <libs/libwolfssl/openssl/crypto.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
|
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
|
||||||
#include <libwolfssl/openssl/dh.h>
|
#include <libs/libwolfssl/openssl/dh.h>
|
||||||
#include <libwolfssl/openssl/objects.h>
|
#include <libs/libwolfssl/openssl/objects.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* need MIN_CODE_E to determine wolfSSL error range */
|
/* need MIN_CODE_E to determine wolfSSL error range */
|
||||||
#include <libwolfssl/wolfcrypt/error-crypt.h>
|
#include <libs/libwolfssl/wolfcrypt/error-crypt.h>
|
||||||
|
|
||||||
/* all NID_* values are in asn.h */
|
/* all NID_* values are in asn.h */
|
||||||
#include <libwolfssl/wolfcrypt/asn.h>
|
#include <libs/libwolfssl/wolfcrypt/asn.h>
|
||||||
|
|
||||||
|
#include <libs/libwolfssl/openssl/x509.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -67,6 +69,9 @@
|
|||||||
#undef ASN1_INTEGER
|
#undef ASN1_INTEGER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPENSSL_EXTRA
|
||||||
|
WOLFSSL_API int wolfSSL_OPENSSL_init_ssl(word64 opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef WOLFSSL SSL;
|
typedef WOLFSSL SSL;
|
||||||
typedef WOLFSSL_SESSION SSL_SESSION;
|
typedef WOLFSSL_SESSION SSL_SESSION;
|
||||||
@ -100,23 +105,33 @@ typedef WOLFSSL_ASN1_INTEGER ASN1_INTEGER;
|
|||||||
typedef WOLFSSL_ASN1_OBJECT ASN1_OBJECT;
|
typedef WOLFSSL_ASN1_OBJECT ASN1_OBJECT;
|
||||||
typedef WOLFSSL_ASN1_STRING ASN1_STRING;
|
typedef WOLFSSL_ASN1_STRING ASN1_STRING;
|
||||||
typedef WOLFSSL_ASN1_TYPE ASN1_TYPE;
|
typedef WOLFSSL_ASN1_TYPE ASN1_TYPE;
|
||||||
|
typedef WOLFSSL_X509_ATTRIBUTE X509_ATTRIBUTE;
|
||||||
typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
|
typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
|
||||||
typedef WOLFSSL_dynlock_value CRYPTO_dynlock_value;
|
typedef WOLFSSL_dynlock_value CRYPTO_dynlock_value;
|
||||||
typedef WOLFSSL_BUF_MEM BUF_MEM;
|
typedef WOLFSSL_BUF_MEM BUF_MEM;
|
||||||
typedef WOLFSSL_GENERAL_NAMES GENERAL_NAMES;
|
typedef WOLFSSL_GENERAL_NAMES GENERAL_NAMES;
|
||||||
typedef WOLFSSL_GENERAL_NAME GENERAL_NAME;
|
typedef WOLFSSL_GENERAL_NAME GENERAL_NAME;
|
||||||
|
|
||||||
|
#define X509_L_FILE_LOAD WOLFSSL_X509_L_FILE_LOAD
|
||||||
|
#define X509_L_ADD_DIR WOLFSSL_X509_L_ADD_DIR
|
||||||
|
#define X509_L_ADD_STORE WOLFSSL_X509_L_ADD_STORE
|
||||||
|
#define X509_L_LOAD_STORE WOLFSSL_X509_L_LOAD_STORE
|
||||||
|
|
||||||
#define ASN1_UTCTIME WOLFSSL_ASN1_TIME
|
#define ASN1_UTCTIME WOLFSSL_ASN1_TIME
|
||||||
#define ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
|
#define ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
|
||||||
|
|
||||||
typedef WOLFSSL_COMP_METHOD COMP_METHOD;
|
typedef WOLFSSL_COMP_METHOD COMP_METHOD;
|
||||||
typedef WOLFSSL_COMP SSL_COMP;
|
typedef WOLFSSL_COMP SSL_COMP;
|
||||||
typedef WOLFSSL_X509_REVOKED X509_REVOKED;
|
typedef WOLFSSL_X509_REVOKED X509_REVOKED;
|
||||||
|
typedef WOLFSSL_X509_LOOKUP_TYPE X509_LOOKUP_TYPE;
|
||||||
typedef WOLFSSL_X509_OBJECT X509_OBJECT;
|
typedef WOLFSSL_X509_OBJECT X509_OBJECT;
|
||||||
typedef WOLFSSL_X509_STORE X509_STORE;
|
typedef WOLFSSL_X509_STORE X509_STORE;
|
||||||
typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
|
typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
|
||||||
typedef WOLFSSL_X509_VERIFY_PARAM X509_VERIFY_PARAM;
|
typedef WOLFSSL_X509_VERIFY_PARAM X509_VERIFY_PARAM;
|
||||||
|
|
||||||
|
typedef int OSSL_HANDSHAKE_STATE;
|
||||||
|
#define TLS_ST_BEFORE 0 /* NULL_STATE from enum states */
|
||||||
|
|
||||||
#define EVP_CIPHER_INFO EncryptedInfo
|
#define EVP_CIPHER_INFO EncryptedInfo
|
||||||
|
|
||||||
#define STACK_OF(x) WOLFSSL_STACK
|
#define STACK_OF(x) WOLFSSL_STACK
|
||||||
@ -126,13 +141,15 @@ typedef WOLFSSL_X509_VERIFY_PARAM X509_VERIFY_PARAM;
|
|||||||
#define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
|
#define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
|
||||||
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
||||||
|
|
||||||
#define CRYPTO_free(xp) XFREE(xp, NULL, DYNAMIC_TYPE_TMP_BUFFER)
|
#define CRYPTO_free wolfSSL_CRYPTO_free
|
||||||
#define CRYPTO_malloc(sz) XMALLOC(sz, NULL, DYNAMIC_TYPE_TMP_BUFFER)
|
#define CRYPTO_malloc wolfSSL_CRYPTO_malloc
|
||||||
#define CRYPTO_EX_new WOLFSSL_CRYPTO_EX_new
|
#define CRYPTO_EX_new WOLFSSL_CRYPTO_EX_new
|
||||||
#define CRYPTO_EX_dup WOLFSSL_CRYPTO_EX_dup
|
#define CRYPTO_EX_dup WOLFSSL_CRYPTO_EX_dup
|
||||||
#define CRYPTO_EX_free WOLFSSL_CRYPTO_EX_free
|
#define CRYPTO_EX_free WOLFSSL_CRYPTO_EX_free
|
||||||
#define CRYPTO_EX_DATA WOLFSSL_CRYPTO_EX_DATA
|
#define CRYPTO_EX_DATA WOLFSSL_CRYPTO_EX_DATA
|
||||||
|
|
||||||
|
#define CRYPTO_set_mem_functions wolfSSL_CRYPTO_set_mem_functions
|
||||||
|
|
||||||
/* depreciated */
|
/* depreciated */
|
||||||
#define CRYPTO_thread_id wolfSSL_thread_id
|
#define CRYPTO_thread_id wolfSSL_thread_id
|
||||||
#define CRYPTO_set_id_callback wolfSSL_set_id_callback
|
#define CRYPTO_set_id_callback wolfSSL_set_id_callback
|
||||||
@ -153,6 +170,9 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define set_ex_data wolfSSL_CRYPTO_set_ex_data
|
#define set_ex_data wolfSSL_CRYPTO_set_ex_data
|
||||||
#define get_ex_data wolfSSL_CRYPTO_get_ex_data
|
#define get_ex_data wolfSSL_CRYPTO_get_ex_data
|
||||||
#define CRYPTO_memcmp wolfSSL_CRYPTO_memcmp
|
#define CRYPTO_memcmp wolfSSL_CRYPTO_memcmp
|
||||||
|
#define CRYPTO_get_ex_new_index wolfSSL_CRYPTO_get_ex_new_index
|
||||||
|
|
||||||
|
#define CRYPTO_get_ex_new_index wolfSSL_CRYPTO_get_ex_new_index
|
||||||
|
|
||||||
/* this function was used to set the default malloc, free, and realloc */
|
/* this function was used to set the default malloc, free, and realloc */
|
||||||
#define CRYPTO_malloc_init() 0 /* CRYPTO_malloc_init is not needed */
|
#define CRYPTO_malloc_init() 0 /* CRYPTO_malloc_init is not needed */
|
||||||
@ -167,11 +187,12 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
|
|
||||||
/* at the moment only returns ok */
|
/* at the moment only returns ok */
|
||||||
#define SSL_get_verify_result wolfSSL_get_verify_result
|
#define SSL_get_verify_result wolfSSL_get_verify_result
|
||||||
#define SSL_get_verify_mode wolfSSL_SSL_get_mode
|
#define SSL_get_verify_mode wolfSSL_get_verify_mode
|
||||||
#define SSL_get_verify_depth wolfSSL_get_verify_depth
|
#define SSL_get_verify_depth wolfSSL_get_verify_depth
|
||||||
#define SSL_CTX_get_verify_mode wolfSSL_CTX_get_verify_mode
|
#define SSL_CTX_get_verify_mode wolfSSL_CTX_get_verify_mode
|
||||||
#define SSL_CTX_get_verify_depth wolfSSL_CTX_get_verify_depth
|
#define SSL_CTX_get_verify_depth wolfSSL_CTX_get_verify_depth
|
||||||
#define SSL_get_certificate wolfSSL_get_certificate
|
#define SSL_get_certificate wolfSSL_get_certificate
|
||||||
|
#define SSL_CTX_get0_certificate wolfSSL_CTX_get0_certificate
|
||||||
#define SSL_use_certificate wolfSSL_use_certificate
|
#define SSL_use_certificate wolfSSL_use_certificate
|
||||||
#define SSL_use_certificate_ASN1 wolfSSL_use_certificate_ASN1
|
#define SSL_use_certificate_ASN1 wolfSSL_use_certificate_ASN1
|
||||||
#define d2i_PKCS8_PRIV_KEY_INFO_bio wolfSSL_d2i_PKCS8_PKEY_bio
|
#define d2i_PKCS8_PRIV_KEY_INFO_bio wolfSSL_d2i_PKCS8_PKEY_bio
|
||||||
@ -179,6 +200,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define i2d_PKCS8PrivateKey_bio wolfSSL_PEM_write_bio_PKCS8PrivateKey
|
#define i2d_PKCS8PrivateKey_bio wolfSSL_PEM_write_bio_PKCS8PrivateKey
|
||||||
#define PKCS8_PRIV_KEY_INFO_free wolfSSL_EVP_PKEY_free
|
#define PKCS8_PRIV_KEY_INFO_free wolfSSL_EVP_PKEY_free
|
||||||
#define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
|
#define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
|
||||||
|
#define SSL_CTX_set_ecdh_auto wolfSSL_CTX_set_ecdh_auto
|
||||||
|
|
||||||
#define i2d_PUBKEY wolfSSL_i2d_PUBKEY
|
#define i2d_PUBKEY wolfSSL_i2d_PUBKEY
|
||||||
#define d2i_PUBKEY wolfSSL_d2i_PUBKEY
|
#define d2i_PUBKEY wolfSSL_d2i_PUBKEY
|
||||||
@ -279,24 +301,39 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define SSL_CTX_set_cert_verify_callback wolfSSL_CTX_set_cert_verify_callback
|
#define SSL_CTX_set_cert_verify_callback wolfSSL_CTX_set_cert_verify_callback
|
||||||
#define SSL_set_verify wolfSSL_set_verify
|
#define SSL_set_verify wolfSSL_set_verify
|
||||||
#define SSL_set_verify_result wolfSSL_set_verify_result
|
#define SSL_set_verify_result wolfSSL_set_verify_result
|
||||||
|
#define SSL_verify_client_post_handshake wolfSSL_verify_client_post_handshake
|
||||||
|
#define SSL_set_post_handshake_auth wolfSSL_set_post_handshake_auth
|
||||||
|
#define SSL_CTX_set_post_handshake_auth wolfSSL_CTX_set_post_handshake_auth
|
||||||
#define SSL_pending wolfSSL_pending
|
#define SSL_pending wolfSSL_pending
|
||||||
#define SSL_load_error_strings wolfSSL_load_error_strings
|
#define SSL_load_error_strings wolfSSL_load_error_strings
|
||||||
#define SSL_library_init wolfSSL_library_init
|
#define SSL_library_init wolfSSL_library_init
|
||||||
|
#define OPENSSL_cleanup (void)wolfSSL_Cleanup
|
||||||
|
#define OPENSSL_init_ssl wolfSSL_OPENSSL_init_ssl
|
||||||
#define OpenSSL_add_ssl_algorithms wolfSSL_library_init
|
#define OpenSSL_add_ssl_algorithms wolfSSL_library_init
|
||||||
#define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode
|
#define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode
|
||||||
#define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list
|
#define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list
|
||||||
#define SSL_CTX_set_ciphersuites wolfSSL_CTX_set_cipher_list
|
#define SSL_CTX_set_ciphersuites wolfSSL_CTX_set_cipher_list
|
||||||
#define SSL_set_cipher_list wolfSSL_set_cipher_list
|
#define SSL_set_cipher_list wolfSSL_set_cipher_list
|
||||||
/* wolfSSL does not support security levels */
|
/* wolfSSL does not support security levels */
|
||||||
#define SSL_CTX_set_security_level(...)
|
#define SSL_CTX_set_security_level wolfSSL_CTX_set_security_level
|
||||||
|
#define SSL_CTX_get_security_level wolfSSL_CTX_get_security_level
|
||||||
/* wolfSSL does not support exporting keying material */
|
/* wolfSSL does not support exporting keying material */
|
||||||
#define SSL_export_keying_material(...) 0
|
#define SSL_export_keying_material wolfSSL_export_keying_material
|
||||||
|
|
||||||
|
#define SSL_CTX_set1_sigalgs_list wolfSSL_CTX_set1_sigalgs_list
|
||||||
|
#define SSL_set1_sigalgs_list wolfSSL_set1_sigalgs_list
|
||||||
|
#define SSL_get_signature_nid wolfSSL_get_signature_nid
|
||||||
|
|
||||||
|
#define SSL_CTX_set1_groups wolfSSL_CTX_set1_groups
|
||||||
|
#define SSL_set1_groups wolfSSL_set1_groups
|
||||||
|
|
||||||
#define SSL_CTX_set1_groups_list wolfSSL_CTX_set1_groups_list
|
#define SSL_CTX_set1_groups_list wolfSSL_CTX_set1_groups_list
|
||||||
#define SSL_set1_groups_list wolfSSL_set1_groups_list
|
#define SSL_set1_groups_list wolfSSL_set1_groups_list
|
||||||
|
|
||||||
#define SSL_set_ex_data wolfSSL_set_ex_data
|
#define SSL_set_ex_data wolfSSL_set_ex_data
|
||||||
#define SSL_get_shutdown wolfSSL_get_shutdown
|
#define SSL_get_shutdown wolfSSL_get_shutdown
|
||||||
|
#define SSL_get_finished wolfSSL_get_finished
|
||||||
|
#define SSL_get_peer_finished wolfSSL_get_peer_finished
|
||||||
#define SSL_set_rfd wolfSSL_set_rfd
|
#define SSL_set_rfd wolfSSL_set_rfd
|
||||||
#define SSL_set_wfd wolfSSL_set_wfd
|
#define SSL_set_wfd wolfSSL_set_wfd
|
||||||
#define SSL_set_shutdown wolfSSL_set_shutdown
|
#define SSL_set_shutdown wolfSSL_set_shutdown
|
||||||
@ -307,6 +344,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define SSL_SESSION_up_ref wolfSSL_SESSION_up_ref
|
#define SSL_SESSION_up_ref wolfSSL_SESSION_up_ref
|
||||||
#define SSL_SESSION_dup wolfSSL_SESSION_dup
|
#define SSL_SESSION_dup wolfSSL_SESSION_dup
|
||||||
#define SSL_SESSION_free wolfSSL_SESSION_free
|
#define SSL_SESSION_free wolfSSL_SESSION_free
|
||||||
|
#define SSL_SESSION_set_cipher wolfSSL_SESSION_set_cipher
|
||||||
#define SSL_is_init_finished wolfSSL_is_init_finished
|
#define SSL_is_init_finished wolfSSL_is_init_finished
|
||||||
|
|
||||||
#define SSL_get_version wolfSSL_get_version
|
#define SSL_get_version wolfSSL_get_version
|
||||||
@ -333,6 +371,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
|
#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
|
||||||
#define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
|
#define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
|
||||||
#define X509_get_ext wolfSSL_X509_get_ext
|
#define X509_get_ext wolfSSL_X509_get_ext
|
||||||
|
#define X509_get_ext_by_OBJ wolfSSL_X509_get_ext_by_OBJ
|
||||||
#define X509_cmp wolfSSL_X509_cmp
|
#define X509_cmp wolfSSL_X509_cmp
|
||||||
#define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
|
#define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
|
||||||
#define X509_EXTENSION_get_critical wolfSSL_X509_EXTENSION_get_critical
|
#define X509_EXTENSION_get_critical wolfSSL_X509_EXTENSION_get_critical
|
||||||
@ -345,14 +384,19 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define DSA_dup_DH wolfSSL_DSA_dup_DH
|
#define DSA_dup_DH wolfSSL_DSA_dup_DH
|
||||||
/* wolfSSL does not support DSA as the cert public key */
|
/* wolfSSL does not support DSA as the cert public key */
|
||||||
#define EVP_PKEY_get0_DSA wolfSSL_EVP_PKEY_get0_DSA
|
#define EVP_PKEY_get0_DSA wolfSSL_EVP_PKEY_get0_DSA
|
||||||
|
#define EVP_PKEY_param_check wolfSSL_EVP_PKEY_param_check
|
||||||
|
#define EVP_PKEY_CTX_free wolfSSL_EVP_PKEY_CTX_free
|
||||||
#define DSA_bits wolfSSL_DSA_bits
|
#define DSA_bits wolfSSL_DSA_bits
|
||||||
|
|
||||||
#define i2d_X509_bio wolfSSL_i2d_X509_bio
|
#define i2d_X509_bio wolfSSL_i2d_X509_bio
|
||||||
|
#define i2d_X509_REQ_bio wolfSSL_i2d_X509_REQ_bio
|
||||||
#define d2i_X509_bio wolfSSL_d2i_X509_bio
|
#define d2i_X509_bio wolfSSL_d2i_X509_bio
|
||||||
|
#define d2i_X509_REQ_bio wolfSSL_d2i_X509_REQ_bio
|
||||||
#define d2i_X509_fp wolfSSL_d2i_X509_fp
|
#define d2i_X509_fp wolfSSL_d2i_X509_fp
|
||||||
#define i2d_X509 wolfSSL_i2d_X509
|
#define i2d_X509 wolfSSL_i2d_X509
|
||||||
#define d2i_X509 wolfSSL_d2i_X509
|
#define d2i_X509 wolfSSL_d2i_X509
|
||||||
#define PEM_read_bio_X509 wolfSSL_PEM_read_bio_X509
|
#define PEM_read_bio_X509 wolfSSL_PEM_read_bio_X509
|
||||||
|
#define PEM_read_bio_X509_REQ wolfSSL_PEM_read_bio_X509_REQ
|
||||||
#define PEM_read_bio_X509_CRL wolfSSL_PEM_read_bio_X509_CRL
|
#define PEM_read_bio_X509_CRL wolfSSL_PEM_read_bio_X509_CRL
|
||||||
#define PEM_read_bio_X509_AUX wolfSSL_PEM_read_bio_X509_AUX
|
#define PEM_read_bio_X509_AUX wolfSSL_PEM_read_bio_X509_AUX
|
||||||
#define PEM_read_X509 wolfSSL_PEM_read_X509
|
#define PEM_read_X509 wolfSSL_PEM_read_X509
|
||||||
@ -363,10 +407,18 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define i2d_PrivateKey wolfSSL_i2d_PrivateKey
|
#define i2d_PrivateKey wolfSSL_i2d_PrivateKey
|
||||||
|
|
||||||
#define i2d_X509_REQ wolfSSL_i2d_X509_REQ
|
#define i2d_X509_REQ wolfSSL_i2d_X509_REQ
|
||||||
|
#define d2i_X509_REQ wolfSSL_d2i_X509_REQ
|
||||||
#define X509_REQ_new wolfSSL_X509_REQ_new
|
#define X509_REQ_new wolfSSL_X509_REQ_new
|
||||||
#define X509_REQ_free wolfSSL_X509_REQ_free
|
#define X509_REQ_free wolfSSL_X509_REQ_free
|
||||||
#define X509_REQ_sign wolfSSL_X509_REQ_sign
|
#define X509_REQ_sign wolfSSL_X509_REQ_sign
|
||||||
|
#define X509_REQ_sign_ctx wolfSSL_X509_REQ_sign_ctx
|
||||||
#define X509_REQ_add_extensions wolfSSL_X509_REQ_add_extensions
|
#define X509_REQ_add_extensions wolfSSL_X509_REQ_add_extensions
|
||||||
|
#define X509_REQ_add1_attr_by_NID wolfSSL_X509_REQ_add1_attr_by_NID
|
||||||
|
#define X509_REQ_add1_attr_by_txt wolfSSL_X509_REQ_add1_attr_by_txt
|
||||||
|
#define X509_REQ_get_attr_by_NID wolfSSL_X509_REQ_get_attr_by_NID
|
||||||
|
#define X509_REQ_get_attr wolfSSL_X509_REQ_get_attr
|
||||||
|
#define X509_ATTRIBUTE_get0_type wolfSSL_X509_ATTRIBUTE_get0_type
|
||||||
|
#define X509_to_X509_REQ wolfSSL_X509_to_X509_REQ
|
||||||
#define X509_REQ_set_subject_name wolfSSL_X509_REQ_set_subject_name
|
#define X509_REQ_set_subject_name wolfSSL_X509_REQ_set_subject_name
|
||||||
#define X509_REQ_set_pubkey wolfSSL_X509_REQ_set_pubkey
|
#define X509_REQ_set_pubkey wolfSSL_X509_REQ_set_pubkey
|
||||||
#define PEM_write_bio_X509_REQ wolfSSL_PEM_write_bio_X509_REQ
|
#define PEM_write_bio_X509_REQ wolfSSL_PEM_write_bio_X509_REQ
|
||||||
@ -376,30 +428,36 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define X509_free wolfSSL_X509_free
|
#define X509_free wolfSSL_X509_free
|
||||||
#define X509_load_certificate_file wolfSSL_X509_load_certificate_file
|
#define X509_load_certificate_file wolfSSL_X509_load_certificate_file
|
||||||
#define X509_digest wolfSSL_X509_digest
|
#define X509_digest wolfSSL_X509_digest
|
||||||
|
#define X509_pubkey_digest wolfSSL_X509_pubkey_digest
|
||||||
#define X509_get_ext_count wolfSSL_X509_get_ext_count
|
#define X509_get_ext_count wolfSSL_X509_get_ext_count
|
||||||
#define X509_get_ext_d2i wolfSSL_X509_get_ext_d2i
|
#define X509_get_ext_d2i wolfSSL_X509_get_ext_d2i
|
||||||
#define X509V3_EXT_i2d wolfSSL_X509V3_EXT_i2d
|
#define X509V3_EXT_i2d wolfSSL_X509V3_EXT_i2d
|
||||||
|
#define X509_get0_extensions wolfSSL_X509_get0_extensions
|
||||||
|
#define X509_get_extensions wolfSSL_X509_get0_extensions
|
||||||
|
#define X509_REQ_get_extensions wolfSSL_X509_REQ_get_extensions
|
||||||
#define X509_get_ext wolfSSL_X509_get_ext
|
#define X509_get_ext wolfSSL_X509_get_ext
|
||||||
#define X509_get_ext_by_NID wolfSSL_X509_get_ext_by_NID
|
#define X509_get_ext_by_NID wolfSSL_X509_get_ext_by_NID
|
||||||
#define X509_get_issuer_name wolfSSL_X509_get_issuer_name
|
#define X509_get_issuer_name wolfSSL_X509_get_issuer_name
|
||||||
#define X509_issuer_name_hash wolfSSL_X509_issuer_name_hash
|
#define X509_issuer_name_hash wolfSSL_X509_issuer_name_hash
|
||||||
#define X509_get_subject_name wolfSSL_X509_get_subject_name
|
|
||||||
#define X509_subject_name_hash wolfSSL_X509_subject_name_hash
|
#define X509_subject_name_hash wolfSSL_X509_subject_name_hash
|
||||||
|
#define X509_get_subject_name wolfSSL_X509_get_subject_name
|
||||||
|
#define X509_REQ_get_subject_name wolfSSL_X509_get_subject_name
|
||||||
#define X509_get_pubkey wolfSSL_X509_get_pubkey
|
#define X509_get_pubkey wolfSSL_X509_get_pubkey
|
||||||
#define X509_get0_pubkey wolfSSL_X509_get_pubkey
|
#define X509_get0_pubkey wolfSSL_X509_get_pubkey
|
||||||
|
#define X509_REQ_get_pubkey wolfSSL_X509_get_pubkey
|
||||||
#define X509_get_notBefore wolfSSL_X509_get_notBefore
|
#define X509_get_notBefore wolfSSL_X509_get_notBefore
|
||||||
#define X509_get0_notBefore wolfSSL_X509_get_notBefore
|
#define X509_get0_notBefore wolfSSL_X509_get_notBefore
|
||||||
|
#define X509_getm_notBefore wolfSSL_X509_get_notBefore
|
||||||
#define X509_get_notAfter wolfSSL_X509_get_notAfter
|
#define X509_get_notAfter wolfSSL_X509_get_notAfter
|
||||||
#define X509_get0_notAfter wolfSSL_X509_get_notAfter
|
#define X509_get0_notAfter wolfSSL_X509_get_notAfter
|
||||||
|
#define X509_getm_notAfter wolfSSL_X509_get_notAfter
|
||||||
#define X509_get_serialNumber wolfSSL_X509_get_serialNumber
|
#define X509_get_serialNumber wolfSSL_X509_get_serialNumber
|
||||||
#define X509_get0_pubkey_bitstr wolfSSL_X509_get0_pubkey_bitstr
|
#define X509_get0_pubkey_bitstr wolfSSL_X509_get0_pubkey_bitstr
|
||||||
#define X509_get_ex_new_index wolfSSL_X509_get_ex_new_index
|
#define X509_get_ex_new_index wolfSSL_X509_get_ex_new_index
|
||||||
#define X509_get_ex_data wolfSSL_X509_get_ex_data
|
#define X509_get_ex_data wolfSSL_X509_get_ex_data
|
||||||
#define X509_set_ex_data wolfSSL_X509_set_ex_data
|
#define X509_set_ex_data wolfSSL_X509_set_ex_data
|
||||||
#define X509_get1_ocsp wolfSSL_X509_get1_ocsp
|
#define X509_get1_ocsp wolfSSL_X509_get1_ocsp
|
||||||
#ifndef WOLFSSL_HAPROXY
|
|
||||||
#define X509_get_version wolfSSL_X509_get_version
|
#define X509_get_version wolfSSL_X509_get_version
|
||||||
#endif
|
|
||||||
#define X509_get_signature_nid wolfSSL_X509_get_signature_nid
|
#define X509_get_signature_nid wolfSSL_X509_get_signature_nid
|
||||||
#define X509_set_subject_name wolfSSL_X509_set_subject_name
|
#define X509_set_subject_name wolfSSL_X509_set_subject_name
|
||||||
#define X509_set_issuer_name wolfSSL_X509_set_issuer_name
|
#define X509_set_issuer_name wolfSSL_X509_set_issuer_name
|
||||||
@ -408,19 +466,31 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define X509_set_notBefore wolfSSL_X509_set_notBefore
|
#define X509_set_notBefore wolfSSL_X509_set_notBefore
|
||||||
#define X509_set_serialNumber wolfSSL_X509_set_serialNumber
|
#define X509_set_serialNumber wolfSSL_X509_set_serialNumber
|
||||||
#define X509_set_version wolfSSL_X509_set_version
|
#define X509_set_version wolfSSL_X509_set_version
|
||||||
|
#define X509_REQ_set_version wolfSSL_X509_set_version
|
||||||
#define X509_sign wolfSSL_X509_sign
|
#define X509_sign wolfSSL_X509_sign
|
||||||
|
#define X509_sign_ctx wolfSSL_X509_sign_ctx
|
||||||
#define X509_print wolfSSL_X509_print
|
#define X509_print wolfSSL_X509_print
|
||||||
|
#define X509_REQ_print wolfSSL_X509_print
|
||||||
#define X509_print_ex wolfSSL_X509_print_ex
|
#define X509_print_ex wolfSSL_X509_print_ex
|
||||||
|
#define X509_print_fp wolfSSL_X509_print_fp
|
||||||
|
#define X509_REQ_print_fp wolfSSL_X509_print_fp
|
||||||
|
#define X509_signature_print wolfSSL_X509_signature_print
|
||||||
|
#define X509_get0_signature wolfSSL_X509_get0_signature
|
||||||
#define X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string
|
#define X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string
|
||||||
#define X509_verify_cert wolfSSL_X509_verify_cert
|
#define X509_verify_cert wolfSSL_X509_verify_cert
|
||||||
|
#define X509_verify wolfSSL_X509_verify
|
||||||
|
#define X509_REQ_verify wolfSSL_X509_REQ_verify
|
||||||
#define X509_check_private_key wolfSSL_X509_check_private_key
|
#define X509_check_private_key wolfSSL_X509_check_private_key
|
||||||
|
#define X509_REQ_check_private_key wolfSSL_X509_check_private_key
|
||||||
#define X509_check_ca wolfSSL_X509_check_ca
|
#define X509_check_ca wolfSSL_X509_check_ca
|
||||||
#define X509_check_host wolfSSL_X509_check_host
|
#define X509_check_host wolfSSL_X509_check_host
|
||||||
|
#define X509_check_email wolfSSL_X509_check_email
|
||||||
#define X509_check_ip_asc wolfSSL_X509_check_ip_asc
|
#define X509_check_ip_asc wolfSSL_X509_check_ip_asc
|
||||||
#define X509_email_free wolfSSL_X509_email_free
|
#define X509_email_free wolfSSL_X509_email_free
|
||||||
#define X509_check_issued wolfSSL_X509_check_issued
|
#define X509_check_issued wolfSSL_X509_check_issued
|
||||||
#define X509_dup wolfSSL_X509_dup
|
#define X509_dup wolfSSL_X509_dup
|
||||||
#define X509_add_ext wolfSSL_X509_add_ext
|
#define X509_add_ext wolfSSL_X509_add_ext
|
||||||
|
#define X509_delete_ext wolfSSL_X509_delete_ext
|
||||||
|
|
||||||
#define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
|
#define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
|
||||||
#define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data
|
#define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data
|
||||||
@ -435,6 +505,10 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define sk_X509_pop_free wolfSSL_sk_X509_pop_free
|
#define sk_X509_pop_free wolfSSL_sk_X509_pop_free
|
||||||
#define sk_X509_dup wolfSSL_sk_dup
|
#define sk_X509_dup wolfSSL_sk_dup
|
||||||
#define sk_X509_free wolfSSL_sk_X509_free
|
#define sk_X509_free wolfSSL_sk_X509_free
|
||||||
|
#define X509_chain_up_ref wolfSSL_X509_chain_up_ref
|
||||||
|
|
||||||
|
#define sk_X509_OBJECT_new wolfSSL_sk_X509_OBJECT_new
|
||||||
|
#define sk_X509_OBJECT_free wolfSSL_sk_X509_OBJECT_free
|
||||||
|
|
||||||
#define sk_X509_EXTENSION_num wolfSSL_sk_X509_EXTENSION_num
|
#define sk_X509_EXTENSION_num wolfSSL_sk_X509_EXTENSION_num
|
||||||
#define sk_X509_EXTENSION_value wolfSSL_sk_X509_EXTENSION_value
|
#define sk_X509_EXTENSION_value wolfSSL_sk_X509_EXTENSION_value
|
||||||
@ -452,6 +526,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define sk_X509_INFO_pop wolfSSL_sk_X509_INFO_pop
|
#define sk_X509_INFO_pop wolfSSL_sk_X509_INFO_pop
|
||||||
#define sk_X509_INFO_pop_free wolfSSL_sk_X509_INFO_pop_free
|
#define sk_X509_INFO_pop_free wolfSSL_sk_X509_INFO_pop_free
|
||||||
#define sk_X509_INFO_free wolfSSL_sk_X509_INFO_free
|
#define sk_X509_INFO_free wolfSSL_sk_X509_INFO_free
|
||||||
|
#define sk_X509_INFO_shift wolfSSL_sk_X509_INFO_pop
|
||||||
|
|
||||||
#define i2d_X509_NAME wolfSSL_i2d_X509_NAME
|
#define i2d_X509_NAME wolfSSL_i2d_X509_NAME
|
||||||
#define d2i_X509_NAME wolfSSL_d2i_X509_NAME
|
#define d2i_X509_NAME wolfSSL_d2i_X509_NAME
|
||||||
@ -468,9 +543,12 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define X509_NAME_add_entry wolfSSL_X509_NAME_add_entry
|
#define X509_NAME_add_entry wolfSSL_X509_NAME_add_entry
|
||||||
#define X509_NAME_add_entry_by_txt wolfSSL_X509_NAME_add_entry_by_txt
|
#define X509_NAME_add_entry_by_txt wolfSSL_X509_NAME_add_entry_by_txt
|
||||||
#define X509_NAME_add_entry_by_NID wolfSSL_X509_NAME_add_entry_by_NID
|
#define X509_NAME_add_entry_by_NID wolfSSL_X509_NAME_add_entry_by_NID
|
||||||
|
#define X509_NAME_delete_entry wolfSSL_X509_NAME_delete_entry
|
||||||
|
#define X509_NAME_hash wolfSSL_X509_NAME_hash
|
||||||
#define X509_NAME_oneline wolfSSL_X509_NAME_oneline
|
#define X509_NAME_oneline wolfSSL_X509_NAME_oneline
|
||||||
#define X509_NAME_get_index_by_NID wolfSSL_X509_NAME_get_index_by_NID
|
#define X509_NAME_get_index_by_NID wolfSSL_X509_NAME_get_index_by_NID
|
||||||
#define X509_NAME_print_ex wolfSSL_X509_NAME_print_ex
|
#define X509_NAME_print_ex wolfSSL_X509_NAME_print_ex
|
||||||
|
#define X509_NAME_print_ex_fp wolfSSL_X509_NAME_print_ex_fp
|
||||||
#define X509_NAME_digest wolfSSL_X509_NAME_digest
|
#define X509_NAME_digest wolfSSL_X509_NAME_digest
|
||||||
#define X509_cmp_current_time wolfSSL_X509_cmp_current_time
|
#define X509_cmp_current_time wolfSSL_X509_cmp_current_time
|
||||||
#define X509_cmp_time wolfSSL_X509_cmp_time
|
#define X509_cmp_time wolfSSL_X509_cmp_time
|
||||||
@ -481,6 +559,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
|||||||
#define sk_ACCESS_DESCRIPTION_value wolfSSL_sk_ACCESS_DESCRIPTION_value
|
#define sk_ACCESS_DESCRIPTION_value wolfSSL_sk_ACCESS_DESCRIPTION_value
|
||||||
|
|
||||||
#define sk_X509_NAME_new wolfSSL_sk_X509_NAME_new
|
#define sk_X509_NAME_new wolfSSL_sk_X509_NAME_new
|
||||||
|
#define sk_X509_NAME_new_null() wolfSSL_sk_X509_NAME_new(NULL)
|
||||||
#define sk_X509_NAME_push wolfSSL_sk_X509_NAME_push
|
#define sk_X509_NAME_push wolfSSL_sk_X509_NAME_push
|
||||||
#define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
|
#define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
|
||||||
#define sk_X509_NAME_set_cmp_func wolfSSL_sk_X509_NAME_set_cmp_func
|
#define sk_X509_NAME_set_cmp_func wolfSSL_sk_X509_NAME_set_cmp_func
|
||||||
@ -505,12 +584,20 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
|
|||||||
#define X509_V_FLAG_NO_CHECK_TIME WOLFSSL_NO_CHECK_TIME
|
#define X509_V_FLAG_NO_CHECK_TIME WOLFSSL_NO_CHECK_TIME
|
||||||
#define X509_CHECK_FLAG_NO_WILDCARDS WOLFSSL_NO_WILDCARDS
|
#define X509_CHECK_FLAG_NO_WILDCARDS WOLFSSL_NO_WILDCARDS
|
||||||
|
|
||||||
|
#define X509_VP_FLAG_DEFAULT WOLFSSL_VPARAM_DEFAULT
|
||||||
|
#define X509_VP_FLAG_OVERWRITE WOLFSSL_VPARAM_OVERWRITE
|
||||||
|
#define X509_VP_FLAG_RESET_FLAGS WOLFSSL_VPARAM_RESET_FLAGS
|
||||||
|
#define X509_VP_FLAG_LOCKED WOLFSSL_VPARAM_LOCKED
|
||||||
|
#define X509_VP_FLAG_ONCE WOLFSSL_VPARAM_ONCE
|
||||||
|
|
||||||
#define X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert
|
#define X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert
|
||||||
#define X509_STORE_CTX_set_verify_cb wolfSSL_X509_STORE_CTX_set_verify_cb
|
#define X509_STORE_CTX_set_verify_cb wolfSSL_X509_STORE_CTX_set_verify_cb
|
||||||
#define X509_STORE_CTX_new wolfSSL_X509_STORE_CTX_new
|
#define X509_STORE_CTX_new wolfSSL_X509_STORE_CTX_new
|
||||||
#define X509_STORE_CTX_free wolfSSL_X509_STORE_CTX_free
|
#define X509_STORE_CTX_free wolfSSL_X509_STORE_CTX_free
|
||||||
#define X509_STORE_CTX_get_chain wolfSSL_X509_STORE_CTX_get_chain
|
#define X509_STORE_CTX_get_chain wolfSSL_X509_STORE_CTX_get_chain
|
||||||
|
#define X509_STORE_CTX_get0_chain wolfSSL_X509_STORE_CTX_get_chain
|
||||||
#define X509_STORE_CTX_get1_chain wolfSSL_X509_STORE_CTX_get1_chain
|
#define X509_STORE_CTX_get1_chain wolfSSL_X509_STORE_CTX_get1_chain
|
||||||
|
#define X509_STORE_CTX_get0_parent_ctx wolfSSL_X509_STORE_CTX_get0_parent_ctx
|
||||||
#define X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error
|
#define X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error
|
||||||
#define X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth
|
#define X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth
|
||||||
#define X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init
|
#define X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init
|
||||||
@ -525,6 +612,7 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
|
|||||||
wolfSSL_X509_STORE_CTX_get0_current_issuer
|
wolfSSL_X509_STORE_CTX_get0_current_issuer
|
||||||
#define X509_STORE_CTX_get0_store wolfSSL_X509_STORE_CTX_get0_store
|
#define X509_STORE_CTX_get0_store wolfSSL_X509_STORE_CTX_get0_store
|
||||||
#define X509_STORE_CTX_get0_cert wolfSSL_X509_STORE_CTX_get0_cert
|
#define X509_STORE_CTX_get0_cert wolfSSL_X509_STORE_CTX_get0_cert
|
||||||
|
#define X509_STORE_CTX_trusted_stack wolfSSL_X509_STORE_CTX_trusted_stack
|
||||||
|
|
||||||
#define X509_STORE_set_verify_cb(s, c) \
|
#define X509_STORE_set_verify_cb(s, c) \
|
||||||
wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
|
wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
|
||||||
@ -540,17 +628,26 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define X509_STORE_set_flags wolfSSL_X509_STORE_set_flags
|
#define X509_STORE_set_flags wolfSSL_X509_STORE_set_flags
|
||||||
#define X509_STORE_get1_certs wolfSSL_X509_STORE_get1_certs
|
#define X509_STORE_get1_certs wolfSSL_X509_STORE_get1_certs
|
||||||
#define X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject
|
#define X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject
|
||||||
|
#define X509_STORE_set_ex_data wolfSSL_X509_STORE_set_ex_data
|
||||||
|
#define X509_STORE_get_ex_data wolfSSL_X509_STORE_get_ex_data
|
||||||
#define X509_STORE_CTX_get1_issuer wolfSSL_X509_STORE_CTX_get1_issuer
|
#define X509_STORE_CTX_get1_issuer wolfSSL_X509_STORE_CTX_get1_issuer
|
||||||
#define X509_STORE_CTX_set_time wolfSSL_X509_STORE_CTX_set_time
|
#define X509_STORE_CTX_set_time wolfSSL_X509_STORE_CTX_set_time
|
||||||
|
#define X509_VERIFY_PARAM_new wolfSSL_X509_VERIFY_PARAM_new
|
||||||
|
#define X509_VERIFY_PARAM_free wolfSSL_X509_VERIFY_PARAM_free
|
||||||
|
#define X509_VERIFY_PARAM_set_flags wolfSSL_X509_VERIFY_PARAM_set_flags
|
||||||
|
#define X509_VERIFY_PARAM_get_flags wolfSSL_X509_VERIFY_PARAM_get_flags
|
||||||
|
#define X509_VERIFY_PARAM_clear_flags wolfSSL_X509_VERIFY_PARAM_clear_flags
|
||||||
#define X509_VERIFY_PARAM_set_hostflags wolfSSL_X509_VERIFY_PARAM_set_hostflags
|
#define X509_VERIFY_PARAM_set_hostflags wolfSSL_X509_VERIFY_PARAM_set_hostflags
|
||||||
#define X509_VERIFY_PARAM_set1_host wolfSSL_X509_VERIFY_PARAM_set1_host
|
#define X509_VERIFY_PARAM_set1_host wolfSSL_X509_VERIFY_PARAM_set1_host
|
||||||
#define X509_VERIFY_PARAM_set1_ip_asc wolfSSL_X509_VERIFY_PARAM_set1_ip_asc
|
#define X509_VERIFY_PARAM_set1_ip_asc wolfSSL_X509_VERIFY_PARAM_set1_ip_asc
|
||||||
|
#define X509_VERIFY_PARAM_set1 wolfSSL_X509_VERIFY_PARAM_set1
|
||||||
#define X509_STORE_load_locations wolfSSL_X509_STORE_load_locations
|
#define X509_STORE_load_locations wolfSSL_X509_STORE_load_locations
|
||||||
|
|
||||||
#define X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir
|
#define X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir
|
||||||
#define X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file
|
#define X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file
|
||||||
#define X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir
|
#define X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir
|
||||||
#define X509_LOOKUP_file wolfSSL_X509_LOOKUP_file
|
#define X509_LOOKUP_file wolfSSL_X509_LOOKUP_file
|
||||||
|
#define X509_LOOKUP_ctrl wolfSSL_X509_LOOKUP_ctrl
|
||||||
|
|
||||||
#define d2i_X509_CRL wolfSSL_d2i_X509_CRL
|
#define d2i_X509_CRL wolfSSL_d2i_X509_CRL
|
||||||
#define d2i_X509_CRL_fp wolfSSL_d2i_X509_CRL_fp
|
#define d2i_X509_CRL_fp wolfSSL_d2i_X509_CRL_fp
|
||||||
@ -561,8 +658,10 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate
|
#define X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate
|
||||||
#define X509_CRL_verify wolfSSL_X509_CRL_verify
|
#define X509_CRL_verify wolfSSL_X509_CRL_verify
|
||||||
#define X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED
|
#define X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED
|
||||||
|
#define X509_load_crl_file wolfSSL_X509_load_crl_file
|
||||||
|
|
||||||
#define X509_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
|
#define X509_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
|
||||||
|
#define X509_REQ_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
|
||||||
#define X509_get0_tbs_sigalg wolfSSL_X509_get0_tbs_sigalg
|
#define X509_get0_tbs_sigalg wolfSSL_X509_get0_tbs_sigalg
|
||||||
#define X509_PUBKEY_get0_param wolfSSL_X509_PUBKEY_get0_param
|
#define X509_PUBKEY_get0_param wolfSSL_X509_PUBKEY_get0_param
|
||||||
#define X509_PUBKEY_get wolfSSL_X509_PUBKEY_get
|
#define X509_PUBKEY_get wolfSSL_X509_PUBKEY_get
|
||||||
@ -580,6 +679,9 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
|
#define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
|
||||||
|
|
||||||
|
#define X509_OBJECT_get0_X509 wolfSSL_X509_OBJECT_get0_X509
|
||||||
|
#define X509_OBJECT_get0_X509_CRL wolfSSL_X509_OBJECT_get0_X509_CRL
|
||||||
|
|
||||||
#define X509_check_purpose(...) 0
|
#define X509_check_purpose(...) 0
|
||||||
|
|
||||||
#define OCSP_parse_url wolfSSL_OCSP_parse_url
|
#define OCSP_parse_url wolfSSL_OCSP_parse_url
|
||||||
@ -610,6 +712,10 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size
|
#define BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size
|
||||||
#define BIO_f_ssl wolfSSL_BIO_f_ssl
|
#define BIO_f_ssl wolfSSL_BIO_f_ssl
|
||||||
#define BIO_new_socket wolfSSL_BIO_new_socket
|
#define BIO_new_socket wolfSSL_BIO_new_socket
|
||||||
|
#define BIO_new_connect wolfSSL_BIO_new_connect
|
||||||
|
#define BIO_set_conn_port wolfSSL_BIO_set_conn_port
|
||||||
|
#define BIO_do_connect wolfSSL_BIO_do_connect
|
||||||
|
#define BIO_do_handshake wolfSSL_BIO_do_handshake
|
||||||
#define SSL_set_bio wolfSSL_set_bio
|
#define SSL_set_bio wolfSSL_set_bio
|
||||||
#define BIO_set_ssl wolfSSL_BIO_set_ssl
|
#define BIO_set_ssl wolfSSL_BIO_set_ssl
|
||||||
#define BIO_eof wolfSSL_BIO_eof
|
#define BIO_eof wolfSSL_BIO_eof
|
||||||
@ -652,15 +758,22 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define sk_ASN1_OBJECT_free wolfSSL_sk_ASN1_OBJECT_free
|
#define sk_ASN1_OBJECT_free wolfSSL_sk_ASN1_OBJECT_free
|
||||||
|
|
||||||
|
#define ASN1_TIME_new wolfSSL_ASN1_TIME_new
|
||||||
|
#define ASN1_UTCTIME_new wolfSSL_ASN1_TIME_new
|
||||||
#define ASN1_TIME_free wolfSSL_ASN1_TIME_free
|
#define ASN1_TIME_free wolfSSL_ASN1_TIME_free
|
||||||
|
#define ASN1_UTCTIME_free wolfSSL_ASN1_TIME_free
|
||||||
#define ASN1_TIME_adj wolfSSL_ASN1_TIME_adj
|
#define ASN1_TIME_adj wolfSSL_ASN1_TIME_adj
|
||||||
#define ASN1_TIME_print wolfSSL_ASN1_TIME_print
|
#define ASN1_TIME_print wolfSSL_ASN1_TIME_print
|
||||||
#define ASN1_TIME_to_generalizedtime wolfSSL_ASN1_TIME_to_generalizedtime
|
#define ASN1_TIME_to_generalizedtime wolfSSL_ASN1_TIME_to_generalizedtime
|
||||||
|
#define ASN1_TIME_set wolfSSL_ASN1_TIME_set
|
||||||
|
#define ASN1_TIME_set_string wolfSSL_ASN1_TIME_set_string
|
||||||
|
#define ASN1_TIME_to_string wolfSSL_ASN1_TIME_to_string
|
||||||
#define ASN1_GENERALIZEDTIME_print wolfSSL_ASN1_GENERALIZEDTIME_print
|
#define ASN1_GENERALIZEDTIME_print wolfSSL_ASN1_GENERALIZEDTIME_print
|
||||||
#define ASN1_GENERALIZEDTIME_free wolfSSL_ASN1_GENERALIZEDTIME_free
|
#define ASN1_GENERALIZEDTIME_free wolfSSL_ASN1_GENERALIZEDTIME_free
|
||||||
|
|
||||||
#define ASN1_tag2str wolfSSL_ASN1_tag2str
|
#define ASN1_tag2str wolfSSL_ASN1_tag2str
|
||||||
|
|
||||||
|
#define a2i_ASN1_INTEGER wolfSSL_a2i_ASN1_INTEGER
|
||||||
#define i2a_ASN1_INTEGER wolfSSL_i2a_ASN1_INTEGER
|
#define i2a_ASN1_INTEGER wolfSSL_i2a_ASN1_INTEGER
|
||||||
#define i2c_ASN1_INTEGER wolfSSL_i2c_ASN1_INTEGER
|
#define i2c_ASN1_INTEGER wolfSSL_i2c_ASN1_INTEGER
|
||||||
#define ASN1_INTEGER_new wolfSSL_ASN1_INTEGER_new
|
#define ASN1_INTEGER_new wolfSSL_ASN1_INTEGER_new
|
||||||
@ -673,13 +786,24 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define i2a_ASN1_OBJECT wolfSSL_i2a_ASN1_OBJECT
|
#define i2a_ASN1_OBJECT wolfSSL_i2a_ASN1_OBJECT
|
||||||
#define i2d_ASN1_OBJECT wolfSSL_i2d_ASN1_OBJECT
|
#define i2d_ASN1_OBJECT wolfSSL_i2d_ASN1_OBJECT
|
||||||
|
|
||||||
|
#define ASN1_STRING_new wolfSSL_ASN1_STRING_new
|
||||||
|
#define ASN1_STRING_free wolfSSL_ASN1_STRING_free
|
||||||
|
#define ASN1_STRING_cmp wolfSSL_ASN1_STRING_cmp
|
||||||
#define ASN1_STRING_data wolfSSL_ASN1_STRING_data
|
#define ASN1_STRING_data wolfSSL_ASN1_STRING_data
|
||||||
#define ASN1_STRING_get0_data wolfSSL_ASN1_STRING_data
|
#define ASN1_STRING_get0_data wolfSSL_ASN1_STRING_get0_data
|
||||||
#define ASN1_STRING_length wolfSSL_ASN1_STRING_length
|
#define ASN1_STRING_length wolfSSL_ASN1_STRING_length
|
||||||
#define ASN1_STRING_to_UTF8 wolfSSL_ASN1_STRING_to_UTF8
|
#define ASN1_STRING_to_UTF8 wolfSSL_ASN1_STRING_to_UTF8
|
||||||
|
#define ASN1_UNIVERSALSTRING_to_string wolfSSL_ASN1_UNIVERSALSTRING_to_string
|
||||||
#define ASN1_STRING_print_ex wolfSSL_ASN1_STRING_print_ex
|
#define ASN1_STRING_print_ex wolfSSL_ASN1_STRING_print_ex
|
||||||
#define ASN1_STRING_print(x, y) wolfSSL_ASN1_STRING_print ((WOLFSSL_BIO*)(x), (WOLFSSL_ASN1_STRING*)(y))
|
#define ASN1_STRING_print(x, y) wolfSSL_ASN1_STRING_print ((WOLFSSL_BIO*)(x), (WOLFSSL_ASN1_STRING*)(y))
|
||||||
#define d2i_DISPLAYTEXT wolfSSL_d2i_DISPLAYTEXT
|
#define d2i_DISPLAYTEXT wolfSSL_d2i_DISPLAYTEXT
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define ASN1_STRING_set_default_mask_asc(...) 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ASN1_OCTET_STRING_free wolfSSL_ASN1_STRING_free
|
||||||
|
|
||||||
|
#define ASN1_PRINTABLE_type(...) V_ASN1_PRINTABLESTRING
|
||||||
|
|
||||||
#define ASN1_UTCTIME_pr wolfSSL_ASN1_UTCTIME_pr
|
#define ASN1_UTCTIME_pr wolfSSL_ASN1_UTCTIME_pr
|
||||||
|
|
||||||
@ -707,6 +831,10 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback
|
#define SSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback
|
||||||
#define SSL_CTX_set_alpn_protos wolfSSL_CTX_set_alpn_protos
|
#define SSL_CTX_set_alpn_protos wolfSSL_CTX_set_alpn_protos
|
||||||
|
|
||||||
|
#define SSL_CTX_keylog_cb_func wolfSSL_CTX_keylog_cb_func
|
||||||
|
#define SSL_CTX_set_keylog_callback wolfSSL_CTX_set_keylog_callback
|
||||||
|
#define SSL_CTX_get_keylog_callback wolfSSL_CTX_get_keylog_callback
|
||||||
|
|
||||||
#define SSL_alert_type_string wolfSSL_alert_type_string
|
#define SSL_alert_type_string wolfSSL_alert_type_string
|
||||||
#define SSL_alert_desc_string wolfSSL_alert_desc_string
|
#define SSL_alert_desc_string wolfSSL_alert_desc_string
|
||||||
#define SSL_state_string wolfSSL_state_string
|
#define SSL_state_string wolfSSL_state_string
|
||||||
@ -715,7 +843,7 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define RSA_generate_key wolfSSL_RSA_generate_key
|
#define RSA_generate_key wolfSSL_RSA_generate_key
|
||||||
#define SSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback
|
#define SSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback
|
||||||
#define RSA_print wolfSSL_RSA_print
|
#define RSA_print wolfSSL_RSA_print
|
||||||
#define RSA_bits wolfSSL_RSA_size
|
#define RSA_bits wolfSSL_RSA_bits
|
||||||
#define RSA_up_ref wolfSSL_RSA_up_ref
|
#define RSA_up_ref wolfSSL_RSA_up_ref
|
||||||
#define RSA_padding_add_PKCS1_PSS wolfSSL_RSA_padding_add_PKCS1_PSS
|
#define RSA_padding_add_PKCS1_PSS wolfSSL_RSA_padding_add_PKCS1_PSS
|
||||||
#define RSA_verify_PKCS1_PSS wolfSSL_RSA_verify_PKCS1_PSS
|
#define RSA_verify_PKCS1_PSS wolfSSL_RSA_verify_PKCS1_PSS
|
||||||
@ -791,6 +919,8 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define ERR_error_string wolfSSL_ERR_error_string
|
#define ERR_error_string wolfSSL_ERR_error_string
|
||||||
#define ERR_error_string_n wolfSSL_ERR_error_string_n
|
#define ERR_error_string_n wolfSSL_ERR_error_string_n
|
||||||
#define ERR_reason_error_string wolfSSL_ERR_reason_error_string
|
#define ERR_reason_error_string wolfSSL_ERR_reason_error_string
|
||||||
|
#define ERR_func_error_string wolfSSL_ERR_func_error_string
|
||||||
|
#define ERR_lib_error_string wolfSSL_ERR_lib_error_string
|
||||||
#define ERR_load_BIO_strings wolfSSL_ERR_load_BIO_strings
|
#define ERR_load_BIO_strings wolfSSL_ERR_load_BIO_strings
|
||||||
|
|
||||||
#ifndef WOLFCRYPT_ONLY
|
#ifndef WOLFCRYPT_ONLY
|
||||||
@ -800,6 +930,13 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define PEMerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
|
#define PEMerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
|
||||||
NULL, __LINE__, __FILE__, NULL)
|
NULL, __LINE__, __FILE__, NULL)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef WOLFCRYPT_ONLY
|
||||||
|
#define EVPerr(func, reason) wolfSSL_ERR_put_error(ERR_LIB_EVP, \
|
||||||
|
(func), (reason), __FILE__, __LINE__)
|
||||||
|
#else
|
||||||
|
#define EVPerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
|
||||||
|
NULL, __LINE__, __FILE__, NULL)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SSLv23_server_method wolfSSLv23_server_method
|
#define SSLv23_server_method wolfSSLv23_server_method
|
||||||
#define SSL_CTX_set_options wolfSSL_CTX_set_options
|
#define SSL_CTX_set_options wolfSSL_CTX_set_options
|
||||||
@ -807,6 +944,7 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_CTX_clear_options wolfSSL_CTX_clear_options
|
#define SSL_CTX_clear_options wolfSSL_CTX_clear_options
|
||||||
|
|
||||||
#define SSL_CTX_check_private_key wolfSSL_CTX_check_private_key
|
#define SSL_CTX_check_private_key wolfSSL_CTX_check_private_key
|
||||||
|
#define SSL_CTX_get0_privatekey wolfSSL_CTX_get0_privatekey
|
||||||
#define SSL_check_private_key wolfSSL_check_private_key
|
#define SSL_check_private_key wolfSSL_check_private_key
|
||||||
|
|
||||||
#define SSL_CTX_set_mode wolfSSL_CTX_set_mode
|
#define SSL_CTX_set_mode wolfSSL_CTX_set_mode
|
||||||
@ -828,8 +966,10 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define sk_num wolfSSL_sk_num
|
#define sk_num wolfSSL_sk_num
|
||||||
#define sk_ASN1_OBJECT_num wolfSSL_sk_num
|
#define sk_ASN1_OBJECT_num wolfSSL_sk_num
|
||||||
|
#define OPENSSL_sk_num wolfSSL_sk_num
|
||||||
#define sk_value wolfSSL_sk_value
|
#define sk_value wolfSSL_sk_value
|
||||||
#define sk_ASN1_OBJECT_value wolfSSL_sk_value
|
#define sk_ASN1_OBJECT_value wolfSSL_sk_value
|
||||||
|
#define OPENSSL_sk_value wolfSSL_sk_value
|
||||||
|
|
||||||
#define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
|
#define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
|
||||||
#define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
|
#define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
|
||||||
@ -897,6 +1037,7 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
|
#define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
|
||||||
|
|
||||||
|
#define DHparams_dup wolfSSL_DH_dup
|
||||||
#define PEM_read_bio_DHparams wolfSSL_PEM_read_bio_DHparams
|
#define PEM_read_bio_DHparams wolfSSL_PEM_read_bio_DHparams
|
||||||
#define PEM_read_bio_DSAparams wolfSSL_PEM_read_bio_DSAparams
|
#define PEM_read_bio_DSAparams wolfSSL_PEM_read_bio_DSAparams
|
||||||
|
|
||||||
@ -918,14 +1059,12 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
|
||||||
|| defined(WOLFSSL_NGINX)
|
|| defined(WOLFSSL_NGINX)
|
||||||
#include <libwolfssl/openssl/pem.h>
|
#include <libs/libwolfssl/openssl/pem.h>
|
||||||
|
|
||||||
#define SSL_CTRL_CHAIN 88
|
#define SSL_CTRL_CHAIN 88
|
||||||
#define ERR_LIB_SSL 20
|
#define ERR_LIB_SSL 20
|
||||||
#define SSL_R_SHORT_READ 10
|
#define SSL_R_SHORT_READ 10
|
||||||
#define ERR_R_PEM_LIB 9
|
#define ERR_R_PEM_LIB 9
|
||||||
#define V_ASN1_IA5STRING 22
|
|
||||||
#define V_ASN1_UTF8STRING 12
|
|
||||||
#define SSL_CTRL_MODE 33
|
#define SSL_CTRL_MODE 33
|
||||||
|
|
||||||
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
|
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
|
||||||
@ -982,13 +1121,22 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define SSL_CTX_set_min_proto_version wolfSSL_CTX_set_min_proto_version
|
#define SSL_CTX_set_min_proto_version wolfSSL_CTX_set_min_proto_version
|
||||||
#define SSL_CTX_set_max_proto_version wolfSSL_CTX_set_max_proto_version
|
#define SSL_CTX_set_max_proto_version wolfSSL_CTX_set_max_proto_version
|
||||||
|
#define SSL_set_min_proto_version wolfSSL_set_min_proto_version
|
||||||
|
#define SSL_set_max_proto_version wolfSSL_set_max_proto_version
|
||||||
|
#define SSL_CTX_get_min_proto_version wolfSSL_CTX_get_min_proto_version
|
||||||
|
|
||||||
#define SSL_get_tlsext_status_exts wolfSSL_get_tlsext_status_exts
|
#define SSL_get_tlsext_status_exts wolfSSL_get_tlsext_status_exts
|
||||||
|
|
||||||
|
#define SSL_CTX_get_tlsext_ticket_keys wolfSSL_CTX_get_tlsext_ticket_keys
|
||||||
|
#define SSL_CTX_set_tlsext_ticket_keys wolfSSL_CTX_set_tlsext_ticket_keys
|
||||||
|
#define SSL_CTX_get_tlsext_status_cb wolfSSL_CTX_get_tlsext_status_cb
|
||||||
|
#define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
|
||||||
|
|
||||||
#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
|
#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
|
||||||
#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
|
#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
|
||||||
#define SSL_CTRL_SET_TMP_DH 3
|
#define SSL_CTRL_SET_TMP_DH 3
|
||||||
#define SSL_CTRL_SET_TMP_ECDH 4
|
#define SSL_CTRL_SET_TMP_ECDH 4
|
||||||
|
#define SSL_CTRL_SET_SESS_CACHE_MODE 44
|
||||||
#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
|
#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
|
||||||
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
|
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
|
||||||
#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
|
#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
|
||||||
@ -997,6 +1145,12 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
|
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
|
||||||
#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
|
#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
|
||||||
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
|
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
|
||||||
|
#define SSL_CTRL_SET_GROUPS 91
|
||||||
|
#define SSL_CTRL_GET_PEER_TMP_KEY 109
|
||||||
|
#define SSL_CTRL_GET_SERVER_TMP_KEY SSL_CTRL_GET_PEER_TMP_KEY
|
||||||
|
#define SSL_CTRL_SET_MIN_PROTO_VERSION 123
|
||||||
|
#define SSL_CTRL_SET_MAX_PROTO_VERSION 124
|
||||||
|
#define SSL_CTRL_SET_CURVES SSL_CTRL_SET_GROUPS
|
||||||
|
|
||||||
#define SSL_CTRL_EXTRA_CHAIN_CERT 14
|
#define SSL_CTRL_EXTRA_CHAIN_CERT 14
|
||||||
#define SSL_CTRL_OPTIONS 32
|
#define SSL_CTRL_OPTIONS 32
|
||||||
@ -1026,15 +1180,35 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define DTLS1_VERSION 0xFEFF
|
#define DTLS1_VERSION 0xFEFF
|
||||||
#define DTLS1_2_VERSION 0xFEFD
|
#define DTLS1_2_VERSION 0xFEFD
|
||||||
|
|
||||||
|
#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
|
||||||
|
#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
|
||||||
|
|
||||||
|
#define CRYPTO_EX_INDEX_SSL 0
|
||||||
|
#define TLS_ANY_VERSION 0x10000
|
||||||
|
#define DTLS1_2_VERSION 0xFEFD
|
||||||
|
#define DTLS_MAX_VERSION DTLS1_2_VERSION
|
||||||
|
|
||||||
|
/* apache and lighty use SSL_CONF_FLAG_FILE to enable conf support */
|
||||||
|
#if !defined(WOLFSSL_APACHE_HTTPD) && !defined(HAVE_LIGHTY)
|
||||||
|
#define SSL_CONF_FLAG_CMDLINE WOLFSSL_CONF_FLAG_CMDLINE
|
||||||
|
#define SSL_CONF_FLAG_FILE WOLFSSL_CONF_FLAG_FILE
|
||||||
|
#define SSL_CONF_FLAG_CERTIFICATE WOLFSSL_CONF_FLAG_CERTIFICATE
|
||||||
|
#define SSL_CONF_TYPE_STRING WOLFSSL_CONF_TYPE_STRING
|
||||||
|
#define SSL_CONF_TYPE_FILE WOLFSSL_CONF_TYPE_FILE
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || defined(OPENSSL_EXTRA) \
|
#if defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || defined(OPENSSL_EXTRA) \
|
||||||
|| defined(OPENSSL_ALL)
|
|| defined(OPENSSL_ALL)
|
||||||
#include <libwolfssl/openssl/asn1.h>
|
#include <libs/libwolfssl/openssl/asn1.h>
|
||||||
|
|
||||||
#define SSL23_ST_SR_CLNT_HELLO_A (0x210|0x2000)
|
#define SSL23_ST_SR_CLNT_HELLO_A (0x210|0x2000)
|
||||||
#define SSL3_ST_SR_CLNT_HELLO_A (0x110|0x2000)
|
#define SSL3_ST_SR_CLNT_HELLO_A (0x110|0x2000)
|
||||||
|
|
||||||
#define SSL3_AD_BAD_CERTIFICATE bad_certificate
|
#define SSL3_AD_BAD_CERTIFICATE bad_certificate
|
||||||
#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
|
#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
|
||||||
|
#define SSL_AD_UNRECOGNIZED_NAME unrecognized_name
|
||||||
|
#define SSL_AD_NO_RENEGOTIATION no_renegotiation
|
||||||
|
#define SSL_AD_INTERNAL_ERROR 80
|
||||||
|
|
||||||
#define ASN1_STRFLGS_ESC_MSB 4
|
#define ASN1_STRFLGS_ESC_MSB 4
|
||||||
|
|
||||||
@ -1074,8 +1248,9 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define SSL3_AL_FATAL 2
|
#define SSL3_AL_FATAL 2
|
||||||
#define SSL_TLSEXT_ERR_OK 0
|
#define SSL_TLSEXT_ERR_OK 0
|
||||||
#define SSL_TLSEXT_ERR_ALERT_FATAL alert_fatal
|
#define SSL_TLSEXT_ERR_ALERT_WARNING warning_return
|
||||||
#define SSL_TLSEXT_ERR_NOACK alert_warning
|
#define SSL_TLSEXT_ERR_ALERT_FATAL fatal_return
|
||||||
|
#define SSL_TLSEXT_ERR_NOACK noack_return
|
||||||
#define TLSEXT_NAMETYPE_host_name WOLFSSL_SNI_HOST_NAME
|
#define TLSEXT_NAMETYPE_host_name WOLFSSL_SNI_HOST_NAME
|
||||||
|
|
||||||
#define SSL_set_tlsext_host_name wolfSSL_set_tlsext_host_name
|
#define SSL_set_tlsext_host_name wolfSSL_set_tlsext_host_name
|
||||||
@ -1089,8 +1264,15 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define PSK_MAX_IDENTITY_LEN 128
|
#define PSK_MAX_IDENTITY_LEN 128
|
||||||
#define SSL_CTX_clear_options wolfSSL_CTX_clear_options
|
#define SSL_CTX_clear_options wolfSSL_CTX_clear_options
|
||||||
|
|
||||||
|
#define SSL_CTX_add_server_custom_ext(...) 0
|
||||||
|
|
||||||
#endif /* HAVE_STUNNEL || WOLFSSL_NGINX */
|
#endif /* HAVE_STUNNEL || WOLFSSL_NGINX */
|
||||||
|
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define b2i_PrivateKey_bio(...) NULL
|
||||||
|
#define b2i_PVK_bio(...) NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SSL_CTX_get_default_passwd_cb wolfSSL_CTX_get_default_passwd_cb
|
#define SSL_CTX_get_default_passwd_cb wolfSSL_CTX_get_default_passwd_cb
|
||||||
#define SSL_CTX_get_default_passwd_cb_userdata wolfSSL_CTX_get_default_passwd_cb_userdata
|
#define SSL_CTX_get_default_passwd_cb_userdata wolfSSL_CTX_get_default_passwd_cb_userdata
|
||||||
|
|
||||||
@ -1123,11 +1305,12 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
#if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
||||||
defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_ALL) || \
|
defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_ALL) || \
|
||||||
defined(HAVE_LIGHTY)
|
defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL)
|
||||||
|
|
||||||
#include <libwolfssl/error-ssl.h>
|
#include <libs/libwolfssl/error-ssl.h>
|
||||||
|
|
||||||
#define OPENSSL_STRING WOLFSSL_STRING
|
#define OPENSSL_STRING WOLFSSL_STRING
|
||||||
|
#define OPENSSL_CSTRING WOLFSSL_STRING
|
||||||
|
|
||||||
#define TLSEXT_TYPE_application_layer_protocol_negotiation 16
|
#define TLSEXT_TYPE_application_layer_protocol_negotiation 16
|
||||||
|
|
||||||
@ -1155,6 +1338,7 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_R_HTTPS_PROXY_REQUEST PARSE_ERROR
|
#define SSL_R_HTTPS_PROXY_REQUEST PARSE_ERROR
|
||||||
#define SSL_R_HTTP_REQUEST PARSE_ERROR
|
#define SSL_R_HTTP_REQUEST PARSE_ERROR
|
||||||
#define SSL_R_UNSUPPORTED_PROTOCOL VERSION_ERROR
|
#define SSL_R_UNSUPPORTED_PROTOCOL VERSION_ERROR
|
||||||
|
#define SSL_R_CERTIFICATE_VERIFY_FAILED VERIFY_CERT_ERROR
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_SESSION_TICKET
|
#ifdef HAVE_SESSION_TICKET
|
||||||
@ -1164,6 +1348,7 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
|
|
||||||
#define OPENSSL_config wolfSSL_OPENSSL_config
|
#define OPENSSL_config wolfSSL_OPENSSL_config
|
||||||
#define OPENSSL_memdup wolfSSL_OPENSSL_memdup
|
#define OPENSSL_memdup wolfSSL_OPENSSL_memdup
|
||||||
|
#define OPENSSL_cleanse wolfSSL_OPENSSL_cleanse
|
||||||
#define SSL_CTX_get_timeout wolfSSL_SSL_CTX_get_timeout
|
#define SSL_CTX_get_timeout wolfSSL_SSL_CTX_get_timeout
|
||||||
#define SSL_CTX_set_tmp_ecdh wolfSSL_SSL_CTX_set_tmp_ecdh
|
#define SSL_CTX_set_tmp_ecdh wolfSSL_SSL_CTX_set_tmp_ecdh
|
||||||
#define SSL_CTX_remove_session wolfSSL_SSL_CTX_remove_session
|
#define SSL_CTX_remove_session wolfSSL_SSL_CTX_remove_session
|
||||||
@ -1176,7 +1361,11 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_CTX_set_tlsext_ticket_key_cb wolfSSL_CTX_set_tlsext_ticket_key_cb
|
#define SSL_CTX_set_tlsext_ticket_key_cb wolfSSL_CTX_set_tlsext_ticket_key_cb
|
||||||
#define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
|
#define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
|
||||||
#define SSL_CTX_get_extra_chain_certs wolfSSL_CTX_get_extra_chain_certs
|
#define SSL_CTX_get_extra_chain_certs wolfSSL_CTX_get_extra_chain_certs
|
||||||
|
#define sk_OPENSSL_STRING_num wolfSSL_sk_WOLFSSL_STRING_num
|
||||||
#define sk_OPENSSL_STRING_value wolfSSL_sk_WOLFSSL_STRING_value
|
#define sk_OPENSSL_STRING_value wolfSSL_sk_WOLFSSL_STRING_value
|
||||||
|
#define sk_OPENSSL_PSTRING_num wolfSSL_sk_WOLFSSL_STRING_num
|
||||||
|
#define sk_OPENSSL_PSTRING_value (WOLFSSL_STRING*)wolfSSL_sk_WOLFSSL_STRING_value
|
||||||
|
#define sk_OPENSSL_STRING_free wolfSSL_sk_free
|
||||||
#define SSL_get0_alpn_selected wolfSSL_get0_alpn_selected
|
#define SSL_get0_alpn_selected wolfSSL_get0_alpn_selected
|
||||||
#define SSL_select_next_proto wolfSSL_select_next_proto
|
#define SSL_select_next_proto wolfSSL_select_next_proto
|
||||||
#define SSL_CTX_set_alpn_select_cb wolfSSL_CTX_set_alpn_select_cb
|
#define SSL_CTX_set_alpn_select_cb wolfSSL_CTX_set_alpn_select_cb
|
||||||
@ -1198,8 +1387,12 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_CTX_add_client_CA wolfSSL_CTX_add_client_CA
|
#define SSL_CTX_add_client_CA wolfSSL_CTX_add_client_CA
|
||||||
#define SSL_CTX_set_srp_password wolfSSL_CTX_set_srp_password
|
#define SSL_CTX_set_srp_password wolfSSL_CTX_set_srp_password
|
||||||
#define SSL_CTX_set_srp_username wolfSSL_CTX_set_srp_username
|
#define SSL_CTX_set_srp_username wolfSSL_CTX_set_srp_username
|
||||||
|
#define SSL_CTX_set_srp_strength wolfSSL_CTX_set_srp_strength
|
||||||
#define SSL_get_SSL_CTX wolfSSL_get_SSL_CTX
|
#define SSL_get_SSL_CTX wolfSSL_get_SSL_CTX
|
||||||
#define SSL_get0_param wolfSSL_get0_param
|
#define SSL_get0_param wolfSSL_get0_param
|
||||||
|
#define SSL_CTX_get0_param wolfSSL_CTX_get0_param
|
||||||
|
#define SSL_CTX_set1_param wolfSSL_CTX_set1_param
|
||||||
|
#define SSL_get_srp_username wolfSSL_get_srp_username
|
||||||
|
|
||||||
#define ERR_NUM_ERRORS 16
|
#define ERR_NUM_ERRORS 16
|
||||||
#define SN_pkcs9_emailAddress "Email"
|
#define SN_pkcs9_emailAddress "Email"
|
||||||
@ -1210,6 +1403,11 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define SSL_get_rbio wolfSSL_SSL_get_rbio
|
#define SSL_get_rbio wolfSSL_SSL_get_rbio
|
||||||
#define SSL_get_wbio wolfSSL_SSL_get_wbio
|
#define SSL_get_wbio wolfSSL_SSL_get_wbio
|
||||||
#define SSL_do_handshake wolfSSL_SSL_do_handshake
|
#define SSL_do_handshake wolfSSL_SSL_do_handshake
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_EARLY_DATA)
|
||||||
|
#define SSL_get_early_data_status wolfSSL_get_early_data_status
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
|
|
||||||
/* cipher suites for compatibility */
|
/* cipher suites for compatibility */
|
||||||
@ -1226,10 +1424,29 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
|
|||||||
#define sk_X509_OBJECT_num wolfSSL_sk_X509_OBJECT_num
|
#define sk_X509_OBJECT_num wolfSSL_sk_X509_OBJECT_num
|
||||||
#define sk_X509_OBJECT_value wolfSSL_sk_X509_OBJECT_value
|
#define sk_X509_OBJECT_value wolfSSL_sk_X509_OBJECT_value
|
||||||
#define sk_X509_OBJECT_delete wolfSSL_sk_X509_OBJECT_delete
|
#define sk_X509_OBJECT_delete wolfSSL_sk_X509_OBJECT_delete
|
||||||
|
#define X509_OBJECT_new wolfSSL_X509_OBJECT_new
|
||||||
#define X509_OBJECT_free wolfSSL_X509_OBJECT_free
|
#define X509_OBJECT_free wolfSSL_X509_OBJECT_free
|
||||||
#define X509_OBJECT_get_type(x) 0
|
#define X509_OBJECT_get_type wolfSSL_X509_OBJECT_get_type
|
||||||
|
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
|
#define OpenSSL_version(x) wolfSSL_OpenSSL_version(x)
|
||||||
|
#else
|
||||||
#define OpenSSL_version(x) wolfSSL_OpenSSL_version()
|
#define OpenSSL_version(x) wolfSSL_OpenSSL_version()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define OBJ_create_objects(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SSL_set_psk_use_session_callback wolfSSL_set_psk_use_session_callback
|
||||||
|
#define SSL_SESSION_is_resumable wolfSSL_SESSION_is_resumable
|
||||||
|
typedef WOLFSSL_CONF_CTX SSL_CONF_CTX;
|
||||||
|
|
||||||
|
#define SSL_CONF_CTX_new wolfSSL_CONF_CTX_new
|
||||||
|
#define SSL_CONF_CTX_free wolfSSL_CONF_CTX_free
|
||||||
|
#define SSL_CONF_CTX_set_ssl_ctx wolfSSL_CONF_CTX_set_ssl_ctx
|
||||||
|
#define SSL_CONF_CTX_set_flags wolfSSL_CONF_CTX_set_flags
|
||||||
|
#define SSL_CONF_CTX_finish wolfSSL_CONF_CTX_finish
|
||||||
|
#define SSL_CONF_cmd wolfSSL_CONF_cmd
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* stack.h
|
/* stack.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -28,15 +28,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libwolfssl/openssl/conf.h>
|
|
||||||
|
|
||||||
typedef void (*wolfSSL_sk_freefunc)(void *);
|
typedef void (*wolfSSL_sk_freefunc)(void *);
|
||||||
|
|
||||||
WOLFSSL_API void wolfSSL_sk_GENERIC_pop_free(WOLFSSL_STACK* sk, wolfSSL_sk_freefunc);
|
WOLFSSL_API void wolfSSL_sk_GENERIC_pop_free(WOLFSSL_STACK* sk, wolfSSL_sk_freefunc);
|
||||||
WOLFSSL_API void wolfSSL_sk_GENERIC_free(WOLFSSL_STACK *);
|
WOLFSSL_API void wolfSSL_sk_GENERIC_free(WOLFSSL_STACK *);
|
||||||
WOLFSSL_API int wolfSSL_sk_GENERIC_push(WOLFSSL_STACK *sk, void *data);
|
WOLFSSL_API int wolfSSL_sk_GENERIC_push(WOLFSSL_STACK *sk, void *data);
|
||||||
WOLFSSL_API void wolfSSL_sk_pop_free(WOLFSSL_STACK *st, void (*func) (void *));
|
WOLFSSL_API void wolfSSL_sk_pop_free(WOLFSSL_STACK *st, void (*func) (void *));
|
||||||
WOLFSSL_API void wolfSSL_sk_CONF_VALUE_free(WOLF_STACK_OF(WOLFSSL_CONF_VALUE)* sk);
|
|
||||||
WOLFSSL_API WOLFSSL_STACK *wolfSSL_sk_new_null(void);
|
WOLFSSL_API WOLFSSL_STACK *wolfSSL_sk_new_null(void);
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_sk_CIPHER_push(WOLFSSL_STACK *st,WOLFSSL_CIPHER *cipher);
|
WOLFSSL_API int wolfSSL_sk_CIPHER_push(WOLFSSL_STACK *st,WOLFSSL_CIPHER *cipher);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* tls1.h
|
/* tls1.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
/* x509.h for openssl */
|
/* x509.h for openssl */
|
||||||
|
|
||||||
#include <libwolfssl/openssl/ssl.h>
|
#include <libs/libwolfssl/openssl/ssl.h>
|
||||||
#include <libwolfssl/openssl/crypto.h>
|
#include <libs/libwolfssl/openssl/crypto.h>
|
||||||
#include <libwolfssl/openssl/dh.h>
|
#include <libs/libwolfssl/openssl/dh.h>
|
||||||
#include <libwolfssl/openssl/ec.h>
|
#include <libs/libwolfssl/openssl/ec.h>
|
||||||
#include <libwolfssl/openssl/ecdsa.h>
|
#include <libs/libwolfssl/openssl/ecdsa.h>
|
||||||
|
#include <libs/libwolfssl/openssl/pkcs7.h>
|
||||||
|
|
||||||
/* wolfSSL_X509_print_ex flags */
|
/* wolfSSL_X509_print_ex flags */
|
||||||
#define X509_FLAG_COMPAT (0UL)
|
#define X509_FLAG_COMPAT (0UL)
|
||||||
@ -23,4 +24,21 @@
|
|||||||
#define X509_FLAG_NO_IDS (1UL << 12)
|
#define X509_FLAG_NO_IDS (1UL << 12)
|
||||||
|
|
||||||
#define XN_FLAG_FN_SN 0
|
#define XN_FLAG_FN_SN 0
|
||||||
#define XN_FLAG_SEP_CPLUS_SPC 2
|
#define XN_FLAG_ONELINE 0
|
||||||
|
#define XN_FLAG_COMPAT 0
|
||||||
|
#define XN_FLAG_RFC2253 1
|
||||||
|
#define XN_FLAG_SEP_COMMA_PLUS (1 << 16)
|
||||||
|
#define XN_FLAG_SEP_CPLUS_SPC (2 << 16)
|
||||||
|
#define XN_FLAG_SEP_SPLUS_SPC (3 << 16)
|
||||||
|
#define XN_FLAG_SEP_MULTILINE (4 << 16)
|
||||||
|
#define XN_FLAG_SEP_MASK (0xF << 16)
|
||||||
|
#define XN_FLAG_DN_REV (1 << 20)
|
||||||
|
#define XN_FLAG_FN_LN (1 << 21)
|
||||||
|
#define XN_FLAG_FN_OID (2 << 21)
|
||||||
|
#define XN_FLAG_FN_NONE (3 << 21)
|
||||||
|
#define XN_FLAG_FN_MASK (3 << 21)
|
||||||
|
#define XN_FLAG_SPC_EQ (1 << 23)
|
||||||
|
#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
|
||||||
|
#define XN_FLAG_FN_ALIGN (1 << 25)
|
||||||
|
|
||||||
|
#define XN_FLAG_MULTILINE 0xFFFF
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* x509_vfy.h
|
/* x509_vfy.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2017 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#ifndef WOLFSSL_x509_vfy_H_
|
#ifndef WOLFSSL_x509_vfy_H_
|
||||||
#define WOLFSSL_x509_vfy_H_
|
#define WOLFSSL_x509_vfy_H_
|
||||||
|
|
||||||
#include <libwolfssl/openssl/x509v3.h>
|
#include <libs/libwolfssl/openssl/x509v3.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* x509v3.h
|
/* x509v3.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,8 +24,8 @@
|
|||||||
#ifndef WOLFSSL_x509v3_H
|
#ifndef WOLFSSL_x509v3_H
|
||||||
#define WOLFSSL_x509v3_H
|
#define WOLFSSL_x509v3_H
|
||||||
|
|
||||||
#include <libwolfssl/openssl/conf.h>
|
#include <libs/libwolfssl/openssl/conf.h>
|
||||||
#include <libwolfssl/openssl/bio.h>
|
#include <libs/libwolfssl/openssl/bio.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -83,6 +83,8 @@ struct WOLFSSL_X509_EXTENSION {
|
|||||||
|
|
||||||
#define X509V3_CTX WOLFSSL_X509V3_CTX
|
#define X509V3_CTX WOLFSSL_X509V3_CTX
|
||||||
|
|
||||||
|
#define CTX_TEST 0x1
|
||||||
|
|
||||||
typedef struct WOLFSSL_AUTHORITY_KEYID AUTHORITY_KEYID;
|
typedef struct WOLFSSL_AUTHORITY_KEYID AUTHORITY_KEYID;
|
||||||
typedef struct WOLFSSL_BASIC_CONSTRAINTS BASIC_CONSTRAINTS;
|
typedef struct WOLFSSL_BASIC_CONSTRAINTS BASIC_CONSTRAINTS;
|
||||||
typedef struct WOLFSSL_ACCESS_DESCRIPTION ACCESS_DESCRIPTION;
|
typedef struct WOLFSSL_ACCESS_DESCRIPTION ACCESS_DESCRIPTION;
|
||||||
@ -99,6 +101,8 @@ WOLFSSL_API char* wolfSSL_i2s_ASN1_STRING(WOLFSSL_v3_ext_method *method,
|
|||||||
const WOLFSSL_ASN1_STRING *s);
|
const WOLFSSL_ASN1_STRING *s);
|
||||||
WOLFSSL_API int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out,
|
WOLFSSL_API int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out,
|
||||||
WOLFSSL_X509_EXTENSION *ext, unsigned long flag, int indent);
|
WOLFSSL_X509_EXTENSION *ext, unsigned long flag, int indent);
|
||||||
|
WOLFSSL_API int wolfSSL_X509V3_EXT_add_nconf(WOLFSSL_CONF *conf, WOLFSSL_X509V3_CTX *ctx,
|
||||||
|
const char *section, WOLFSSL_X509 *cert);
|
||||||
|
|
||||||
#define BASIC_CONSTRAINTS_free wolfSSL_BASIC_CONSTRAINTS_free
|
#define BASIC_CONSTRAINTS_free wolfSSL_BASIC_CONSTRAINTS_free
|
||||||
#define AUTHORITY_KEYID_free wolfSSL_AUTHORITY_KEYID_free
|
#define AUTHORITY_KEYID_free wolfSSL_AUTHORITY_KEYID_free
|
||||||
@ -107,11 +111,20 @@ WOLFSSL_API int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out,
|
|||||||
#define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
|
#define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
|
||||||
#define X509V3_EXT_get wolfSSL_X509V3_EXT_get
|
#define X509V3_EXT_get wolfSSL_X509V3_EXT_get
|
||||||
#define X509V3_EXT_d2i wolfSSL_X509V3_EXT_d2i
|
#define X509V3_EXT_d2i wolfSSL_X509V3_EXT_d2i
|
||||||
|
#define X509V3_EXT_add_nconf wolfSSL_X509V3_EXT_add_nconf
|
||||||
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define X509V3_parse_list(...) NULL
|
||||||
|
#endif
|
||||||
#define i2s_ASN1_OCTET_STRING wolfSSL_i2s_ASN1_STRING
|
#define i2s_ASN1_OCTET_STRING wolfSSL_i2s_ASN1_STRING
|
||||||
#define X509V3_EXT_print wolfSSL_X509V3_EXT_print
|
#define X509V3_EXT_print wolfSSL_X509V3_EXT_print
|
||||||
#define X509V3_EXT_conf_nid wolfSSL_X509V3_EXT_conf_nid
|
#define X509V3_EXT_conf_nid wolfSSL_X509V3_EXT_conf_nid
|
||||||
#define X509V3_set_ctx wolfSSL_X509V3_set_ctx
|
#define X509V3_set_ctx wolfSSL_X509V3_set_ctx
|
||||||
#define X509V3_set_ctx_nodb wolfSSL_X509V3_set_ctx_nodb
|
#ifndef NO_WOLFSSL_STUB
|
||||||
|
#define X509V3_set_nconf(...)
|
||||||
|
#endif
|
||||||
|
#define X509V3_set_ctx_test(ctx) wolfSSL_X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
|
||||||
|
#define X509V3_set_ctx_nodb wolfSSL_X509V3_set_ctx_nodb
|
||||||
|
#define X509v3_get_ext_count wolfSSL_sk_num
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* sniffer.h
|
/* sniffer.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,7 +24,8 @@
|
|||||||
#ifndef WOLFSSL_SNIFFER_H
|
#ifndef WOLFSSL_SNIFFER_H
|
||||||
#define WOLFSSL_SNIFFER_H
|
#define WOLFSSL_SNIFFER_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
#include <libs/libwolfssl/wolfcrypt/asn_public.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef SSL_SNIFFER_EXPORTS
|
#ifdef SSL_SNIFFER_EXPORTS
|
||||||
@ -182,8 +183,6 @@ typedef struct SSLStats
|
|||||||
unsigned long int sslDecryptedPackets;
|
unsigned long int sslDecryptedPackets;
|
||||||
unsigned long int sslKeyMatches;
|
unsigned long int sslKeyMatches;
|
||||||
unsigned long int sslEncryptedConns;
|
unsigned long int sslEncryptedConns;
|
||||||
|
|
||||||
unsigned long int sslResumptionValid;
|
|
||||||
unsigned long int sslResumptionInserts;
|
unsigned long int sslResumptionInserts;
|
||||||
} SSLStats;
|
} SSLStats;
|
||||||
|
|
||||||
@ -199,7 +198,21 @@ SSL_SNIFFER_API int ssl_ReadStatistics(SSLStats* stats);
|
|||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
SSL_SNIFFER_API int ssl_ReadResetStatistics(SSLStats* stats);
|
SSL_SNIFFER_API int ssl_ReadResetStatistics(SSLStats* stats);
|
||||||
|
|
||||||
|
typedef int (*SSLKeyCb)(void* vSniffer, int namedGroup,
|
||||||
|
const unsigned char* srvPub, unsigned int srvPubSz,
|
||||||
|
const unsigned char* cliPub, unsigned int cliPubSz,
|
||||||
|
DerBuffer* privKey, void* cbCtx, char* error);
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_STATIC_EPHEMERAL) && defined(WOLFSSL_TLS13)
|
||||||
|
/* macro indicating support for key callback */
|
||||||
|
#undef WOLFSSL_SNIFFER_KEY_CALLBACK
|
||||||
|
#define WOLFSSL_SNIFFER_KEY_CALLBACK
|
||||||
|
WOLFSSL_API
|
||||||
|
SSL_SNIFFER_API int ssl_SetKeyCallback(SSLKeyCb cb, void* cbCtx);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SNIFFER_WATCH
|
||||||
typedef int (*SSLWatchCb)(void* vSniffer,
|
typedef int (*SSLWatchCb)(void* vSniffer,
|
||||||
const unsigned char* certHash,
|
const unsigned char* certHash,
|
||||||
unsigned int certHashSz,
|
unsigned int certHashSz,
|
||||||
@ -226,29 +239,37 @@ WOLFSSL_API
|
|||||||
SSL_SNIFFER_API int ssl_SetWatchKey_file(void* vSniffer,
|
SSL_SNIFFER_API int ssl_SetWatchKey_file(void* vSniffer,
|
||||||
const char* keyFile, int keyType,
|
const char* keyFile, int keyType,
|
||||||
const char* password, char* error);
|
const char* password, char* error);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SNIFFER_STORE_DATA_CB
|
||||||
typedef int (*SSLStoreDataCb)(const unsigned char* decryptBuf,
|
typedef int (*SSLStoreDataCb)(const unsigned char* decryptBuf,
|
||||||
unsigned int decryptBufSz, unsigned int decryptBufOffset, void* ctx);
|
unsigned int decryptBufSz, unsigned int decryptBufOffset, void* ctx);
|
||||||
|
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
SSL_SNIFFER_API int ssl_SetStoreDataCallback(SSLStoreDataCb cb);
|
SSL_SNIFFER_API int ssl_SetStoreDataCallback(SSLStoreDataCb cb);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SNIFFER_STORE_DATA_CB
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
SSL_SNIFFER_API int ssl_DecodePacketWithSessionInfoStoreData(
|
SSL_SNIFFER_API int ssl_DecodePacketWithSessionInfoStoreData(
|
||||||
const unsigned char* packet, int length, void* ctx,
|
const unsigned char* packet, int length, void* ctx,
|
||||||
SSLInfo* sslInfo, char* error);
|
SSLInfo* sslInfo, char* error);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SNIFFER_CHAIN_INPUT
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
SSL_SNIFFER_API int ssl_DecodePacketWithChain(void* vChain,
|
SSL_SNIFFER_API int ssl_DecodePacketWithChain(void* vChain,
|
||||||
unsigned int chainSz, unsigned char** data, char* error);
|
unsigned int chainSz, unsigned char** data, char* error);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_SNIFFER_CHAIN_INPUT) && \
|
||||||
|
defined(WOLFSSL_SNIFFER_STORE_DATA_CB)
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
SSL_SNIFFER_API int ssl_DecodePacketWithChainSessionInfoStoreData(
|
SSL_SNIFFER_API int ssl_DecodePacketWithChainSessionInfoStoreData(
|
||||||
void* vChain, unsigned int chainSz, void* ctx, SSLInfo* sslInfo,
|
void* vChain, unsigned int chainSz, void* ctx, SSLInfo* sslInfo,
|
||||||
char* error);
|
char* error);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* sniffer_error.h
|
/* sniffer_error.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -24,6 +24,13 @@
|
|||||||
#ifndef WOLFSSL_SNIFFER_ERROR_H
|
#ifndef WOLFSSL_SNIFFER_ERROR_H
|
||||||
#define WOLFSSL_SNIFFER_ERROR_H
|
#define WOLFSSL_SNIFFER_ERROR_H
|
||||||
|
|
||||||
|
|
||||||
|
/* General Sniffer Error */
|
||||||
|
#define WOLFSSL_SNIFFER_ERROR -1
|
||||||
|
|
||||||
|
/* Sniffer failed and is in Fatal state */
|
||||||
|
#define WOLFSSL_SNIFFER_FATAL_ERROR -2
|
||||||
|
|
||||||
/* need to have errors as #defines since .rc files can't handle enums */
|
/* need to have errors as #defines since .rc files can't handle enums */
|
||||||
/* need to start at 1 and go in order for same reason */
|
/* need to start at 1 and go in order for same reason */
|
||||||
|
|
||||||
@ -109,7 +116,6 @@
|
|||||||
#define GOT_CERT_STATUS_STR 73
|
#define GOT_CERT_STATUS_STR 73
|
||||||
#define RSA_KEY_MISSING_STR 74
|
#define RSA_KEY_MISSING_STR 74
|
||||||
#define NO_SECURE_RENEGOTIATION 75
|
#define NO_SECURE_RENEGOTIATION 75
|
||||||
|
|
||||||
#define BAD_SESSION_STATS 76
|
#define BAD_SESSION_STATS 76
|
||||||
#define REASSEMBLY_MAX_STR 77
|
#define REASSEMBLY_MAX_STR 77
|
||||||
#define DROPPING_LOST_FRAG_STR 78
|
#define DROPPING_LOST_FRAG_STR 78
|
||||||
@ -131,6 +137,7 @@
|
|||||||
#define STORE_DATA_FAIL_STR 92
|
#define STORE_DATA_FAIL_STR 92
|
||||||
#define CHAIN_INPUT_STR 93
|
#define CHAIN_INPUT_STR 93
|
||||||
#define GOT_ENC_EXT_STR 94
|
#define GOT_ENC_EXT_STR 94
|
||||||
|
#define GOT_HELLO_RETRY_REQ_STR 95
|
||||||
/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
|
/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
/* wolfssl_version.h.in
|
/* wolfssl_version.h.in
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -28,8 +28,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LIBWOLFSSL_VERSION_STRING "4.5.0"
|
#define LIBWOLFSSL_VERSION_STRING "4.8.1"
|
||||||
#define LIBWOLFSSL_VERSION_HEX 0x04005000
|
#define LIBWOLFSSL_VERSION_HEX 0x04008001
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* aes.h
|
/* aes.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -34,13 +34,13 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
#ifndef WOLF_CRYPT_AES_H
|
#ifndef WOLF_CRYPT_AES_H
|
||||||
#define WOLF_CRYPT_AES_H
|
#define WOLF_CRYPT_AES_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
|
|
||||||
#if defined(HAVE_FIPS) && \
|
#if defined(HAVE_FIPS) && \
|
||||||
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
|
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
|
||||||
#include <libwolfssl/wolfcrypt/fips.h>
|
#include <libs/libwolfssl/wolfcrypt/fips.h>
|
||||||
#endif /* HAVE_FIPS_VERSION >= 2 */
|
#endif /* HAVE_FIPS_VERSION >= 2 */
|
||||||
|
|
||||||
/* included for fips @wc_fips */
|
/* included for fips @wc_fips */
|
||||||
@ -56,10 +56,10 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WC_NO_RNG
|
#ifndef WC_NO_RNG
|
||||||
#include <libwolfssl/wolfcrypt/random.h>
|
#include <libs/libwolfssl/wolfcrypt/random.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef STM32_CRYPTO
|
#ifdef STM32_CRYPTO
|
||||||
#include <libwolfssl/wolfcrypt/port/st/stm32.h>
|
#include <libs/libwolfssl/wolfcrypt/port/st/stm32.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFSSL_IMXRT_DCP
|
#ifdef WOLFSSL_IMXRT_DCP
|
||||||
@ -72,24 +72,29 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
|
|
||||||
#if defined(WOLFSSL_AFALG) || defined(WOLFSSL_AFALG_XILINX_AES)
|
#if defined(WOLFSSL_AFALG) || defined(WOLFSSL_AFALG_XILINX_AES)
|
||||||
/* included for struct msghdr */
|
/* included for struct msghdr */
|
||||||
#include <libwolfssl/wolfcrypt/port/af_alg/wc_afalg.h>
|
#include <libs/libwolfssl/wolfcrypt/port/af_alg/wc_afalg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WOLFSSL_DEVCRYPTO_AES) || defined(WOLFSSL_DEVCRYPTO_CBC)
|
#if defined(WOLFSSL_DEVCRYPTO_AES) || defined(WOLFSSL_DEVCRYPTO_CBC)
|
||||||
#include <libwolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h>
|
#include <libs/libwolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SILABS_SE_ACCEL
|
||||||
|
#include <libs/libwolfssl/wolfcrypt/port/silabs/silabs_aes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_AESGCM) && !defined(WC_NO_RNG)
|
#if defined(HAVE_AESGCM) && !defined(WC_NO_RNG)
|
||||||
#include <libwolfssl/wolfcrypt/random.h>
|
#include <libs/libwolfssl/wolfcrypt/random.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WOLFSSL_CRYPTOCELL)
|
#if defined(WOLFSSL_CRYPTOCELL)
|
||||||
#include <libwolfssl/wolfcrypt/port/arm/cryptoCell.h>
|
#include <libs/libwolfssl/wolfcrypt/port/arm/cryptoCell.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
|
#if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
|
||||||
defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
|
defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
|
||||||
#include <libwolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
|
#include <libs/libwolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -113,7 +118,7 @@ enum {
|
|||||||
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
|
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
|
||||||
|
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
#include <libwolfssl/wolfcrypt/async.h>
|
#include <libs/libwolfssl/wolfcrypt/async.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -143,7 +148,8 @@ enum {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PKCS11
|
#ifdef HAVE_PKCS11
|
||||||
AES_MAX_ID_LEN = 32,
|
AES_MAX_ID_LEN = 32,
|
||||||
|
AES_MAX_LABEL_LEN = 32,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -171,6 +177,12 @@ struct Aes {
|
|||||||
#ifdef GCM_TABLE
|
#ifdef GCM_TABLE
|
||||||
/* key-based fast multiplication table. */
|
/* key-based fast multiplication table. */
|
||||||
ALIGN16 byte M0[256][AES_BLOCK_SIZE];
|
ALIGN16 byte M0[256][AES_BLOCK_SIZE];
|
||||||
|
#elif defined(GCM_TABLE_4BIT)
|
||||||
|
#if defined(BIG_ENDIAN_ORDER) || defined(WC_16BIT_CPU)
|
||||||
|
ALIGN16 byte M0[16][AES_BLOCK_SIZE];
|
||||||
|
#else
|
||||||
|
ALIGN16 byte M0[32][AES_BLOCK_SIZE];
|
||||||
|
#endif
|
||||||
#endif /* GCM_TABLE */
|
#endif /* GCM_TABLE */
|
||||||
#ifdef HAVE_CAVIUM_OCTEON_SYNC
|
#ifdef HAVE_CAVIUM_OCTEON_SYNC
|
||||||
word32 y0;
|
word32 y0;
|
||||||
@ -186,6 +198,8 @@ struct Aes {
|
|||||||
#ifdef HAVE_PKCS11
|
#ifdef HAVE_PKCS11
|
||||||
byte id[AES_MAX_ID_LEN];
|
byte id[AES_MAX_ID_LEN];
|
||||||
int idLen;
|
int idLen;
|
||||||
|
char label[AES_MAX_LABEL_LEN];
|
||||||
|
int labelLen;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
WC_ASYNC_DEV asyncDev;
|
WC_ASYNC_DEV asyncDev;
|
||||||
@ -231,8 +245,26 @@ struct Aes {
|
|||||||
#endif
|
#endif
|
||||||
#if defined(WOLFSSL_IMXRT_DCP)
|
#if defined(WOLFSSL_IMXRT_DCP)
|
||||||
dcp_handle_t handle;
|
dcp_handle_t handle;
|
||||||
|
#endif
|
||||||
|
#if defined(WOLFSSL_SILABS_SE_ACCEL)
|
||||||
|
silabs_aes_t ctx;
|
||||||
#endif
|
#endif
|
||||||
void* heap; /* memory hint to use */
|
void* heap; /* memory hint to use */
|
||||||
|
#ifdef WOLFSSL_AESGCM_STREAM
|
||||||
|
#if !defined(WOLFSSL_SMALL_STACK) || defined(WOLFSSL_AESNI)
|
||||||
|
ALIGN16 byte streamData[5 * AES_BLOCK_SIZE];
|
||||||
|
#else
|
||||||
|
byte* streamData;
|
||||||
|
#endif
|
||||||
|
word32 aSz;
|
||||||
|
word32 cSz;
|
||||||
|
byte over;
|
||||||
|
byte aOver;
|
||||||
|
byte cOver;
|
||||||
|
byte gcmKeySet:1;
|
||||||
|
byte nonceSet:1;
|
||||||
|
byte ctrSet:1;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef WC_AES_TYPE_DEFINED
|
#ifndef WC_AES_TYPE_DEFINED
|
||||||
@ -344,6 +376,26 @@ WOLFSSL_API int wc_AesEcbDecrypt(Aes* aes, byte* out,
|
|||||||
const byte* iv, word32 ivSz,
|
const byte* iv, word32 ivSz,
|
||||||
const byte* authTag, word32 authTagSz,
|
const byte* authTag, word32 authTagSz,
|
||||||
const byte* authIn, word32 authInSz);
|
const byte* authIn, word32 authInSz);
|
||||||
|
#ifdef WOLFSSL_AESGCM_STREAM
|
||||||
|
WOLFSSL_API int wc_AesGcmInit(Aes* aes, const byte* key, word32 len,
|
||||||
|
const byte* iv, word32 ivSz);
|
||||||
|
|
||||||
|
WOLFSSL_API int wc_AesGcmEncryptInit(Aes* aes, const byte* key, word32 len,
|
||||||
|
const byte* iv, word32 ivSz);
|
||||||
|
WOLFSSL_API int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len,
|
||||||
|
byte* ivOut, word32 ivOutSz);
|
||||||
|
WOLFSSL_API int wc_AesGcmEncryptUpdate(Aes* aes, byte* out, const byte* in,
|
||||||
|
word32 sz, const byte* authIn, word32 authInSz);
|
||||||
|
WOLFSSL_API int wc_AesGcmEncryptFinal(Aes* aes, byte* authTag,
|
||||||
|
word32 authTagSz);
|
||||||
|
|
||||||
|
WOLFSSL_API int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len,
|
||||||
|
const byte* iv, word32 ivSz);
|
||||||
|
WOLFSSL_API int wc_AesGcmDecryptUpdate(Aes* aes, byte* out, const byte* in,
|
||||||
|
word32 sz, const byte* authIn, word32 authInSz);
|
||||||
|
WOLFSSL_API int wc_AesGcmDecryptFinal(Aes* aes, const byte* authTag,
|
||||||
|
word32 authTagSz);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WC_NO_RNG
|
#ifndef WC_NO_RNG
|
||||||
WOLFSSL_API int wc_AesGcmSetExtIV(Aes* aes, const byte* iv, word32 ivSz);
|
WOLFSSL_API int wc_AesGcmSetExtIV(Aes* aes, const byte* iv, word32 ivSz);
|
||||||
@ -399,10 +451,18 @@ WOLFSSL_API int wc_AesEcbDecrypt(Aes* aes, byte* out,
|
|||||||
const byte* in, word32 inSz,
|
const byte* in, word32 inSz,
|
||||||
byte* out, word32 outSz,
|
byte* out, word32 outSz,
|
||||||
const byte* iv);
|
const byte* iv);
|
||||||
|
WOLFSSL_API int wc_AesKeyWrap_ex(Aes *aes,
|
||||||
|
const byte* in, word32 inSz,
|
||||||
|
byte* out, word32 outSz,
|
||||||
|
const byte* iv);
|
||||||
WOLFSSL_API int wc_AesKeyUnWrap(const byte* key, word32 keySz,
|
WOLFSSL_API int wc_AesKeyUnWrap(const byte* key, word32 keySz,
|
||||||
const byte* in, word32 inSz,
|
const byte* in, word32 inSz,
|
||||||
byte* out, word32 outSz,
|
byte* out, word32 outSz,
|
||||||
const byte* iv);
|
const byte* iv);
|
||||||
|
WOLFSSL_API int wc_AesKeyUnWrap_ex(Aes *aes,
|
||||||
|
const byte* in, word32 inSz,
|
||||||
|
byte* out, word32 outSz,
|
||||||
|
const byte* iv);
|
||||||
#endif /* HAVE_AES_KEYWRAP */
|
#endif /* HAVE_AES_KEYWRAP */
|
||||||
|
|
||||||
#ifdef WOLFSSL_AES_XTS
|
#ifdef WOLFSSL_AES_XTS
|
||||||
@ -431,6 +491,8 @@ WOLFSSL_API int wc_AesInit(Aes* aes, void* heap, int devId);
|
|||||||
#ifdef HAVE_PKCS11
|
#ifdef HAVE_PKCS11
|
||||||
WOLFSSL_API int wc_AesInit_Id(Aes* aes, unsigned char* id, int len, void* heap,
|
WOLFSSL_API int wc_AesInit_Id(Aes* aes, unsigned char* id, int len, void* heap,
|
||||||
int devId);
|
int devId);
|
||||||
|
WOLFSSL_API int wc_AesInit_Label(Aes* aes, const char* label, void* heap,
|
||||||
|
int devId);
|
||||||
#endif
|
#endif
|
||||||
WOLFSSL_API void wc_AesFree(Aes* aes);
|
WOLFSSL_API void wc_AesFree(Aes* aes);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* arc4.h
|
/* arc4.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -26,14 +26,14 @@
|
|||||||
#ifndef WOLF_CRYPT_ARC4_H
|
#ifndef WOLF_CRYPT_ARC4_H
|
||||||
#define WOLF_CRYPT_ARC4_H
|
#define WOLF_CRYPT_ARC4_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
#include <libwolfssl/wolfcrypt/async.h>
|
#include <libs/libwolfssl/wolfcrypt/async.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* asn.h
|
/* asn.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -34,7 +34,7 @@ that can be serialized and deserialized in a cross-platform way.
|
|||||||
#ifndef WOLF_CRYPT_ASN_H
|
#ifndef WOLF_CRYPT_ASN_H
|
||||||
#define WOLF_CRYPT_ASN_H
|
#define WOLF_CRYPT_ASN_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifndef NO_ASN
|
#ifndef NO_ASN
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ that can be serialized and deserialized in a cross-platform way.
|
|||||||
#define NO_ASN_TIME /* backwards compatibility with NO_TIME_H */
|
#define NO_ASN_TIME /* backwards compatibility with NO_TIME_H */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/integer.h>
|
#include <libs/libwolfssl/wolfcrypt/integer.h>
|
||||||
|
|
||||||
/* fips declare of RsaPrivateKeyDecode @wc_fips */
|
/* fips declare of RsaPrivateKeyDecode @wc_fips */
|
||||||
#if defined(HAVE_FIPS) && !defined(NO_RSA) && \
|
#if defined(HAVE_FIPS) && !defined(NO_RSA) && \
|
||||||
@ -52,19 +52,19 @@ that can be serialized and deserialized in a cross-platform way.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
#include <libwolfssl/wolfcrypt/dh.h>
|
#include <libs/libwolfssl/wolfcrypt/dh.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef NO_DSA
|
||||||
#include <libwolfssl/wolfcrypt/dsa.h>
|
#include <libs/libwolfssl/wolfcrypt/dsa.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SHA
|
#ifndef NO_SHA
|
||||||
#include <libwolfssl/wolfcrypt/sha.h>
|
#include <libs/libwolfssl/wolfcrypt/sha.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
#include <libwolfssl/wolfcrypt/md5.h>
|
#include <libs/libwolfssl/wolfcrypt/md5.h>
|
||||||
#endif
|
#endif
|
||||||
#include <libwolfssl/wolfcrypt/sha256.h>
|
#include <libs/libwolfssl/wolfcrypt/sha256.h>
|
||||||
#include <libwolfssl/wolfcrypt/asn_public.h> /* public interface */
|
#include <libs/libwolfssl/wolfcrypt/asn_public.h> /* public interface */
|
||||||
|
|
||||||
#if defined(NO_SHA) && defined(NO_SHA256)
|
#if defined(NO_SHA) && defined(NO_SHA256)
|
||||||
#define WC_SHA256_DIGEST_SIZE 32
|
#define WC_SHA256_DIGEST_SIZE 32
|
||||||
@ -100,6 +100,7 @@ enum ASN_Tags {
|
|||||||
ASN_SEQUENCE = 0x10,
|
ASN_SEQUENCE = 0x10,
|
||||||
ASN_SET = 0x11,
|
ASN_SET = 0x11,
|
||||||
ASN_PRINTABLE_STRING = 0x13,
|
ASN_PRINTABLE_STRING = 0x13,
|
||||||
|
ASN_IA5_STRING = 0x16,
|
||||||
ASN_UTC_TIME = 0x17,
|
ASN_UTC_TIME = 0x17,
|
||||||
ASN_OTHER_TYPE = 0x00,
|
ASN_OTHER_TYPE = 0x00,
|
||||||
ASN_RFC822_TYPE = 0x01,
|
ASN_RFC822_TYPE = 0x01,
|
||||||
@ -139,9 +140,13 @@ enum DN_Tags {
|
|||||||
/* pilot attribute types
|
/* pilot attribute types
|
||||||
* OID values of 0.9.2342.19200300.100.1.* */
|
* OID values of 0.9.2342.19200300.100.1.* */
|
||||||
ASN_USER_ID = 0x01, /* UID */
|
ASN_USER_ID = 0x01, /* UID */
|
||||||
|
ASN_FAVOURITE_DRINK = 0x05, /* favouriteDrink */
|
||||||
ASN_DOMAIN_COMPONENT = 0x19 /* DC */
|
ASN_DOMAIN_COMPONENT = 0x19 /* DC */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* This is the size of the smallest possible PEM header and footer */
|
||||||
|
extern const int pem_struct_min_sz;
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||||
typedef struct WOLFSSL_ObjectInfo {
|
typedef struct WOLFSSL_ObjectInfo {
|
||||||
int nid;
|
int nid;
|
||||||
@ -178,6 +183,7 @@ extern const WOLFSSL_ObjectInfo wolfssl_object_info[];
|
|||||||
|
|
||||||
#define WOLFSSL_USER_ID "/UID="
|
#define WOLFSSL_USER_ID "/UID="
|
||||||
#define WOLFSSL_DOMAIN_COMPONENT "/DC="
|
#define WOLFSSL_DOMAIN_COMPONENT "/DC="
|
||||||
|
#define WOLFSSL_FAVOURITE_DRINK "/favouriteDrink="
|
||||||
|
|
||||||
#if defined(WOLFSSL_APACHE_HTTPD)
|
#if defined(WOLFSSL_APACHE_HTTPD)
|
||||||
/* otherName strings */
|
/* otherName strings */
|
||||||
@ -192,6 +198,7 @@ extern const WOLFSSL_ObjectInfo wolfssl_object_info[];
|
|||||||
#define WOLFSSL_TLS_FEATURE_SUM 92
|
#define WOLFSSL_TLS_FEATURE_SUM 92
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||||
/* NIDs */
|
/* NIDs */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -202,6 +209,7 @@ enum
|
|||||||
NID_sha256 = 672,
|
NID_sha256 = 672,
|
||||||
NID_sha384 = 673,
|
NID_sha384 = 673,
|
||||||
NID_sha512 = 674,
|
NID_sha512 = 674,
|
||||||
|
NID_pkcs9_challengePassword = 54,
|
||||||
NID_hw_name_oid = 73,
|
NID_hw_name_oid = 73,
|
||||||
NID_id_pkix_OCSP_basic = 74,
|
NID_id_pkix_OCSP_basic = 74,
|
||||||
NID_any_policy = 75,
|
NID_any_policy = 75,
|
||||||
@ -228,6 +236,7 @@ enum
|
|||||||
NID_inhibit_any_policy = 168, /* 2.5.29.54 */
|
NID_inhibit_any_policy = 168, /* 2.5.29.54 */
|
||||||
NID_tlsfeature = 1020, /* id-pe 24 */
|
NID_tlsfeature = 1020, /* id-pe 24 */
|
||||||
NID_commonName = 0x03, /* matches ASN_COMMON_NAME in asn.h */
|
NID_commonName = 0x03, /* matches ASN_COMMON_NAME in asn.h */
|
||||||
|
NID_buildingName = 1494,
|
||||||
|
|
||||||
|
|
||||||
NID_surname = 0x04, /* SN */
|
NID_surname = 0x04, /* SN */
|
||||||
@ -241,6 +250,7 @@ enum
|
|||||||
NID_jurisdictionStateOrProvinceName = 0xd,
|
NID_jurisdictionStateOrProvinceName = 0xd,
|
||||||
NID_businessCategory = ASN_BUS_CAT,
|
NID_businessCategory = ASN_BUS_CAT,
|
||||||
NID_domainComponent = ASN_DOMAIN_COMPONENT,
|
NID_domainComponent = ASN_DOMAIN_COMPONENT,
|
||||||
|
NID_favouriteDrink = 462,
|
||||||
NID_userId = 458,
|
NID_userId = 458,
|
||||||
NID_emailAddress = 0x30, /* emailAddress */
|
NID_emailAddress = 0x30, /* emailAddress */
|
||||||
NID_id_on_dnsSRV = 82, /* 1.3.6.1.5.5.7.8.7 */
|
NID_id_on_dnsSRV = 82, /* 1.3.6.1.5.5.7.8.7 */
|
||||||
@ -248,6 +258,7 @@ enum
|
|||||||
|
|
||||||
NID_X9_62_prime_field = 406 /* 1.2.840.10045.1.1 */
|
NID_X9_62_prime_field = 406 /* 1.2.840.10045.1.1 */
|
||||||
};
|
};
|
||||||
|
#endif /* OPENSSL_EXTRA */
|
||||||
|
|
||||||
enum ECC_TYPES
|
enum ECC_TYPES
|
||||||
{
|
{
|
||||||
@ -299,12 +310,17 @@ enum Misc_ASN {
|
|||||||
KEYID_SIZE = WC_SHA_DIGEST_SIZE,
|
KEYID_SIZE = WC_SHA_DIGEST_SIZE,
|
||||||
#endif
|
#endif
|
||||||
RSA_INTS = 8, /* RSA ints in private key */
|
RSA_INTS = 8, /* RSA ints in private key */
|
||||||
|
DSA_PARAM_INTS = 3, /* DSA paramater ints */
|
||||||
DSA_INTS = 5, /* DSA ints in private key */
|
DSA_INTS = 5, /* DSA ints in private key */
|
||||||
MIN_DATE_SIZE = 13,
|
MIN_DATE_SIZE = 12,
|
||||||
MAX_DATE_SIZE = 32,
|
MAX_DATE_SIZE = 32,
|
||||||
ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
|
ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
MAX_ENCODED_SIG_SZ = 512,
|
#ifdef WOLFSSL_HAPROXY
|
||||||
|
MAX_ENCODED_SIG_SZ = 1024, /* Supports 8192 bit keys */
|
||||||
|
#else
|
||||||
|
MAX_ENCODED_SIG_SZ = 512, /* Supports 4096 bit keys */
|
||||||
|
#endif
|
||||||
#elif defined(HAVE_ECC)
|
#elif defined(HAVE_ECC)
|
||||||
MAX_ENCODED_SIG_SZ = 140,
|
MAX_ENCODED_SIG_SZ = 140,
|
||||||
#elif defined(HAVE_CURVE448)
|
#elif defined(HAVE_CURVE448)
|
||||||
@ -324,7 +340,7 @@ enum Misc_ASN {
|
|||||||
MAX_ENCODED_DIG_ASN_SZ= 9, /* enum(bit or octet) + length(4) */
|
MAX_ENCODED_DIG_ASN_SZ= 9, /* enum(bit or octet) + length(4) */
|
||||||
MAX_ENCODED_DIG_SZ = 64 + MAX_ENCODED_DIG_ASN_SZ, /* asn header + sha512 */
|
MAX_ENCODED_DIG_SZ = 64 + MAX_ENCODED_DIG_ASN_SZ, /* asn header + sha512 */
|
||||||
MAX_RSA_INT_SZ = 517, /* RSA raw sz 4096 for bits + tag + len(4) */
|
MAX_RSA_INT_SZ = 517, /* RSA raw sz 4096 for bits + tag + len(4) */
|
||||||
MAX_DSA_INT_SZ = 261, /* DSA raw sz 2048 for bits + tag + len(4) */
|
MAX_DSA_INT_SZ = 389, /* DSA raw sz 3072 for bits + tag + len(4) */
|
||||||
MAX_NTRU_KEY_SZ = 610, /* NTRU 112 bit public key */
|
MAX_NTRU_KEY_SZ = 610, /* NTRU 112 bit public key */
|
||||||
MAX_NTRU_ENC_SZ = 628, /* NTRU 112 bit DER public encoding */
|
MAX_NTRU_ENC_SZ = 628, /* NTRU 112 bit DER public encoding */
|
||||||
MAX_LENGTH_SZ = 4, /* Max length size for DER encoding */
|
MAX_LENGTH_SZ = 4, /* Max length size for DER encoding */
|
||||||
@ -382,6 +398,9 @@ enum Misc_ASN {
|
|||||||
MIN_VERSION_SZ = 3, /* Min bytes needed for GetMyVersion */
|
MIN_VERSION_SZ = 3, /* Min bytes needed for GetMyVersion */
|
||||||
MAX_X509_VERSION = 3, /* Max X509 version allowed */
|
MAX_X509_VERSION = 3, /* Max X509 version allowed */
|
||||||
MIN_X509_VERSION = 0, /* Min X509 version allowed */
|
MIN_X509_VERSION = 0, /* Min X509 version allowed */
|
||||||
|
WOLFSSL_X509_V1 = 0,
|
||||||
|
WOLFSSL_X509_V2 = 1,
|
||||||
|
WOLFSSL_X509_V3 = 2,
|
||||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
|
||||||
defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
||||||
defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7)
|
defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7)
|
||||||
@ -422,6 +441,7 @@ enum Oid_Types {
|
|||||||
oidCertNameType = 17,
|
oidCertNameType = 17,
|
||||||
oidTlsExtType = 18,
|
oidTlsExtType = 18,
|
||||||
oidCrlExtType = 19,
|
oidCrlExtType = 19,
|
||||||
|
oidCsrAttrType = 20,
|
||||||
oidIgnoreType
|
oidIgnoreType
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -521,23 +541,23 @@ enum HMAC_Sum {
|
|||||||
|
|
||||||
|
|
||||||
enum Extensions_Sum {
|
enum Extensions_Sum {
|
||||||
BASIC_CA_OID = 133,
|
BASIC_CA_OID = 133, /* 2.5.29.19 */
|
||||||
ALT_NAMES_OID = 131,
|
ALT_NAMES_OID = 131, /* 2.5.29.17 */
|
||||||
CRL_DIST_OID = 145,
|
CRL_DIST_OID = 145, /* 2.5.29.31 */
|
||||||
AUTH_INFO_OID = 69, /* id-pe 1 */
|
AUTH_INFO_OID = 69, /* 1.3.6.1.5.5.7.1.1 */
|
||||||
AUTH_KEY_OID = 149,
|
AUTH_KEY_OID = 149, /* 2.5.29.35 */
|
||||||
SUBJ_KEY_OID = 128,
|
SUBJ_KEY_OID = 128, /* 2.5.29.14 */
|
||||||
CERT_POLICY_OID = 146,
|
CERT_POLICY_OID = 146, /* 2.5.29.32 */
|
||||||
KEY_USAGE_OID = 129, /* 2.5.29.15 */
|
KEY_USAGE_OID = 129, /* 2.5.29.15 */
|
||||||
INHIBIT_ANY_OID = 168, /* 2.5.29.54 */
|
INHIBIT_ANY_OID = 168, /* 2.5.29.54 */
|
||||||
EXT_KEY_USAGE_OID = 151, /* 2.5.29.37 */
|
EXT_KEY_USAGE_OID = 151, /* 2.5.29.37 */
|
||||||
NAME_CONS_OID = 144, /* 2.5.29.30 */
|
NAME_CONS_OID = 144, /* 2.5.29.30 */
|
||||||
PRIV_KEY_USAGE_PERIOD_OID = 130, /* 2.5.29.16 */
|
PRIV_KEY_USAGE_PERIOD_OID = 130, /* 2.5.29.16 */
|
||||||
SUBJECT_INFO_ACCESS = 79, /* id-pe 11 */
|
SUBJECT_INFO_ACCESS = 79, /* 1.3.6.1.5.5.7.1.11 */
|
||||||
POLICY_MAP_OID = 147,
|
POLICY_MAP_OID = 147, /* 2.5.29.33 */
|
||||||
POLICY_CONST_OID = 150,
|
POLICY_CONST_OID = 150, /* 2.5.29.36 */
|
||||||
ISSUE_ALT_NAMES_OID = 132,
|
ISSUE_ALT_NAMES_OID = 132, /* 2.5.29.18 */
|
||||||
TLS_FEATURE_OID = 92, /* id-pe 24 */
|
TLS_FEATURE_OID = 92, /* 1.3.6.1.5.5.7.1.24 */
|
||||||
NETSCAPE_CT_OID = 753, /* 2.16.840.1.113730.1.1 */
|
NETSCAPE_CT_OID = 753, /* 2.16.840.1.113730.1.1 */
|
||||||
OCSP_NOCHECK_OID = 121 /* 1.3.6.1.5.5.7.48.1.5
|
OCSP_NOCHECK_OID = 121 /* 1.3.6.1.5.5.7.48.1.5
|
||||||
id-pkix-ocsp-nocheck */
|
id-pkix-ocsp-nocheck */
|
||||||
@ -579,6 +599,7 @@ enum VerifyType {
|
|||||||
VERIFY_OCSP = 3,
|
VERIFY_OCSP = 3,
|
||||||
VERIFY_NAME = 4,
|
VERIFY_NAME = 4,
|
||||||
VERIFY_SKIP_DATE = 5,
|
VERIFY_SKIP_DATE = 5,
|
||||||
|
VERIFY_OCSP_CERT = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WOLFSSL_CERT_EXT
|
#ifdef WOLFSSL_CERT_EXT
|
||||||
@ -588,6 +609,14 @@ enum KeyIdType {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_CERT_REQ
|
||||||
|
enum CsrAttrType {
|
||||||
|
CHALLENGE_PASSWORD_OID = 659,
|
||||||
|
SERIAL_NUMBER_OID = 94,
|
||||||
|
EXTENSION_REQUEST_OID = 666,
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Key usage extension bits (based on RFC 5280) */
|
/* Key usage extension bits (based on RFC 5280) */
|
||||||
#define KEYUSE_DIGITAL_SIG 0x0080
|
#define KEYUSE_DIGITAL_SIG 0x0080
|
||||||
#define KEYUSE_CONTENT_COMMIT 0x0040
|
#define KEYUSE_CONTENT_COMMIT 0x0040
|
||||||
@ -660,15 +689,21 @@ struct SignatureCtx {
|
|||||||
byte* digest;
|
byte* digest;
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
byte* out;
|
byte* out;
|
||||||
byte* plain;
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
|
#if !(defined(NO_RSA) && defined(NO_DSA))
|
||||||
|
byte* sigCpy;
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
|
||||||
|
!defined(NO_DSA)
|
||||||
int verify;
|
int verify;
|
||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
struct RsaKey* rsa;
|
struct RsaKey* rsa;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef NO_DSA
|
||||||
|
struct DsaKey* dsa;
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
struct ecc_key* ecc;
|
struct ecc_key* ecc;
|
||||||
#endif
|
#endif
|
||||||
@ -766,6 +801,7 @@ struct DecodedCert {
|
|||||||
DNS_entry* altNames; /* alt names list of dns entries */
|
DNS_entry* altNames; /* alt names list of dns entries */
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
#ifndef IGNORE_NAME_CONSTRAINTS
|
||||||
DNS_entry* altEmailNames; /* alt names list of RFC822 entries */
|
DNS_entry* altEmailNames; /* alt names list of RFC822 entries */
|
||||||
|
DNS_entry* altDirNames; /* alt names list of DIR entries */
|
||||||
Base_entry* permittedNames; /* Permitted name bases */
|
Base_entry* permittedNames; /* Permitted name bases */
|
||||||
Base_entry* excludedNames; /* Excluded name bases */
|
Base_entry* excludedNames; /* Excluded name bases */
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
#endif /* IGNORE_NAME_CONSTRAINTS */
|
||||||
@ -805,6 +841,7 @@ struct DecodedCert {
|
|||||||
byte maxPathLen; /* max_path_len see RFC 5280 section
|
byte maxPathLen; /* max_path_len see RFC 5280 section
|
||||||
* 6.1.2 "Initialization" - (k) for
|
* 6.1.2 "Initialization" - (k) for
|
||||||
* description of max_path_len */
|
* description of max_path_len */
|
||||||
|
byte policyConstSkip; /* Policy Constraints skip certs value */
|
||||||
word16 extKeyUsage; /* Key usage bitfield */
|
word16 extKeyUsage; /* Key usage bitfield */
|
||||||
byte extExtKeyUsage; /* Extended Key usage bitfield */
|
byte extExtKeyUsage; /* Extended Key usage bitfield */
|
||||||
|
|
||||||
@ -888,6 +925,14 @@ struct DecodedCert {
|
|||||||
int extCertPoliciesNb;
|
int extCertPoliciesNb;
|
||||||
#endif /* defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT) */
|
#endif /* defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT) */
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_CERT_REQ
|
||||||
|
/* CSR attributes */
|
||||||
|
char* cPwd; /* challengePassword */
|
||||||
|
int cPwdLen;
|
||||||
|
char* sNum; /* Serial Number */
|
||||||
|
int sNumLen;
|
||||||
|
#endif /* WOLFSSL_CERT_REQ */
|
||||||
|
|
||||||
Signer* ca;
|
Signer* ca;
|
||||||
#ifndef NO_CERTS
|
#ifndef NO_CERTS
|
||||||
SignatureCtx sigCtx;
|
SignatureCtx sigCtx;
|
||||||
@ -917,6 +962,9 @@ struct DecodedCert {
|
|||||||
byte extCRLdistSet : 1;
|
byte extCRLdistSet : 1;
|
||||||
byte extAuthInfoSet : 1;
|
byte extAuthInfoSet : 1;
|
||||||
byte extBasicConstSet : 1;
|
byte extBasicConstSet : 1;
|
||||||
|
byte extPolicyConstSet : 1;
|
||||||
|
byte extPolicyConstRxpSet : 1; /* requireExplicitPolicy set */
|
||||||
|
byte extPolicyConstIpmSet : 1; /* inhibitPolicyMapping set */
|
||||||
byte extSubjAltNameSet : 1;
|
byte extSubjAltNameSet : 1;
|
||||||
byte inhibitAnyOidSet : 1;
|
byte inhibitAnyOidSet : 1;
|
||||||
byte selfSigned : 1; /* Indicates subject and issuer are same */
|
byte selfSigned : 1; /* Indicates subject and issuer are same */
|
||||||
@ -927,6 +975,7 @@ struct DecodedCert {
|
|||||||
byte extCRLdistCrit : 1;
|
byte extCRLdistCrit : 1;
|
||||||
byte extAuthInfoCrit : 1;
|
byte extAuthInfoCrit : 1;
|
||||||
byte extBasicConstCrit : 1;
|
byte extBasicConstCrit : 1;
|
||||||
|
byte extPolicyConstCrit : 1;
|
||||||
byte extSubjAltNameCrit : 1;
|
byte extSubjAltNameCrit : 1;
|
||||||
byte extAuthKeyIdCrit : 1;
|
byte extAuthKeyIdCrit : 1;
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
#ifndef IGNORE_NAME_CONSTRAINTS
|
||||||
@ -939,9 +988,19 @@ struct DecodedCert {
|
|||||||
#if defined(WOLFSSL_SEP) || defined(WOLFSSL_QT)
|
#if defined(WOLFSSL_SEP) || defined(WOLFSSL_QT)
|
||||||
byte extCertPolicyCrit : 1;
|
byte extCertPolicyCrit : 1;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef WOLFSSL_CERT_REQ
|
||||||
|
byte isCSR : 1; /* Do we intend on parsing a CSR? */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ASN Encoded Name field */
|
||||||
|
typedef struct EncodedName {
|
||||||
|
int nameLen; /* actual string value length */
|
||||||
|
int totalLen; /* total encoded length */
|
||||||
|
int type; /* type of name */
|
||||||
|
int used; /* are we actually using this one */
|
||||||
|
byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
|
||||||
|
} EncodedName;
|
||||||
|
|
||||||
#ifdef NO_SHA
|
#ifdef NO_SHA
|
||||||
#define SIGNER_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
|
#define SIGNER_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
|
||||||
@ -1015,6 +1074,42 @@ struct TrustedPeerCert {
|
|||||||
#define WOLFSSL_ASN_API WOLFSSL_LOCAL
|
#define WOLFSSL_ASN_API WOLFSSL_LOCAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SMIME
|
||||||
|
#define MIME_HEADER_ASCII_MIN 33
|
||||||
|
#define MIME_HEADER_ASCII_MAX 126
|
||||||
|
|
||||||
|
typedef struct MimeParam MimeParam;
|
||||||
|
typedef struct MimeHdr MimeHdr;
|
||||||
|
|
||||||
|
struct MimeParam
|
||||||
|
{
|
||||||
|
MimeParam* next;
|
||||||
|
char* attribute;
|
||||||
|
char* value;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MimeHdr
|
||||||
|
{
|
||||||
|
MimeHdr* next;
|
||||||
|
MimeParam* params;
|
||||||
|
char* name;
|
||||||
|
char* body;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef enum MimeTypes
|
||||||
|
{
|
||||||
|
MIME_HDR,
|
||||||
|
MIME_PARAM
|
||||||
|
} MimeTypes;
|
||||||
|
|
||||||
|
typedef enum MimeStatus
|
||||||
|
{
|
||||||
|
MIME_NAMEATTR,
|
||||||
|
MIME_BODYVAL
|
||||||
|
} MimeStatus;
|
||||||
|
#endif /* HAVE_SMIME */
|
||||||
|
|
||||||
|
|
||||||
WOLFSSL_LOCAL int CalcHashId(const byte* data, word32 len, byte* hash);
|
WOLFSSL_LOCAL int CalcHashId(const byte* data, word32 len, byte* hash);
|
||||||
WOLFSSL_LOCAL int GetName(DecodedCert* cert, int nameType, int maxIdx);
|
WOLFSSL_LOCAL int GetName(DecodedCert* cert, int nameType, int maxIdx);
|
||||||
|
|
||||||
@ -1036,6 +1131,12 @@ WOLFSSL_LOCAL int EncodePolicyOID(byte *out, word32 *outSz,
|
|||||||
WOLFSSL_API int CheckCertSignature(const byte*,word32,void*,void* cm);
|
WOLFSSL_API int CheckCertSignature(const byte*,word32,void*,void* cm);
|
||||||
WOLFSSL_LOCAL int CheckCertSignaturePubKey(const byte* cert, word32 certSz,
|
WOLFSSL_LOCAL int CheckCertSignaturePubKey(const byte* cert, word32 certSz,
|
||||||
void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
|
void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
|
||||||
|
#ifdef WOLFSSL_CERT_REQ
|
||||||
|
WOLFSSL_LOCAL int CheckCSRSignaturePubKey(const byte* cert, word32 certSz, void* heap,
|
||||||
|
const byte* pubKey, word32 pubKeySz, int pubKeyOID);
|
||||||
|
#endif /* WOLFSSL_CERT_REQ */
|
||||||
|
WOLFSSL_LOCAL int AddSignature(byte* buf, int bodySz, const byte* sig, int sigSz,
|
||||||
|
int sigAlgoType);
|
||||||
WOLFSSL_LOCAL int ParseCertRelative(DecodedCert*,int type,int verify,void* cm);
|
WOLFSSL_LOCAL int ParseCertRelative(DecodedCert*,int type,int verify,void* cm);
|
||||||
WOLFSSL_LOCAL int DecodeToKey(DecodedCert*, int verify);
|
WOLFSSL_LOCAL int DecodeToKey(DecodedCert*, int verify);
|
||||||
WOLFSSL_LOCAL int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate);
|
WOLFSSL_LOCAL int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate);
|
||||||
@ -1086,6 +1187,10 @@ WOLFSSL_LOCAL int DateGreaterThan(const struct tm* a, const struct tm* b);
|
|||||||
WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType);
|
WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType);
|
||||||
WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn);
|
WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn);
|
||||||
|
|
||||||
|
WOLFSSL_LOCAL int wc_EncodeName(EncodedName* name, const char* nameStr,
|
||||||
|
char nameType, byte type);
|
||||||
|
WOLFSSL_LOCAL int wc_EncodeNameCanonical(EncodedName* name, const char* nameStr,
|
||||||
|
char nameType, byte type);
|
||||||
/* ASN.1 helper functions */
|
/* ASN.1 helper functions */
|
||||||
#ifdef WOLFSSL_CERT_GEN
|
#ifdef WOLFSSL_CERT_GEN
|
||||||
WOLFSSL_ASN_API int SetName(byte* output, word32 outputSz, CertName* name);
|
WOLFSSL_ASN_API int SetName(byte* output, word32 outputSz, CertName* name);
|
||||||
@ -1108,6 +1213,8 @@ WOLFSSL_LOCAL int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
|
|||||||
word32 maxIdx, int check);
|
word32 maxIdx, int check);
|
||||||
WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
|
WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
|
||||||
word32 maxIdx);
|
word32 maxIdx);
|
||||||
|
WOLFSSL_LOCAL int CheckBitString(const byte* input, word32* inOutIdx, int* len,
|
||||||
|
word32 maxIdx, int zeroBits, byte* unusedBits);
|
||||||
WOLFSSL_LOCAL int GetSet(const byte* input, word32* inOutIdx, int* len,
|
WOLFSSL_LOCAL int GetSet(const byte* input, word32* inOutIdx, int* len,
|
||||||
word32 maxIdx);
|
word32 maxIdx);
|
||||||
WOLFSSL_LOCAL int GetSet_ex(const byte* input, word32* inOutIdx, int* len,
|
WOLFSSL_LOCAL int GetSet_ex(const byte* input, word32* inOutIdx, int* len,
|
||||||
@ -1136,12 +1243,7 @@ WOLFSSL_LOCAL int GetASNTag(const byte* input, word32* idx, byte* tag,
|
|||||||
WOLFSSL_LOCAL word32 SetLength(word32 length, byte* output);
|
WOLFSSL_LOCAL word32 SetLength(word32 length, byte* output);
|
||||||
WOLFSSL_LOCAL word32 SetSequence(word32 len, byte* output);
|
WOLFSSL_LOCAL word32 SetSequence(word32 len, byte* output);
|
||||||
WOLFSSL_LOCAL word32 SetOctetString(word32 len, byte* output);
|
WOLFSSL_LOCAL word32 SetOctetString(word32 len, byte* output);
|
||||||
#if (defined(WOLFSSL_QT) || defined(OPENSSL_ALL)) && !defined(NO_DH) \
|
WOLFSSL_LOCAL int SetASNInt(int len, byte firstByte, byte* output);
|
||||||
|| defined(WOLFSSL_OPENSSH)
|
|
||||||
WOLFSSL_LOCAL int wc_DhParamsToDer(DhKey* key, byte* out, word32* outSz);
|
|
||||||
WOLFSSL_LOCAL int wc_DhPubKeyToDer(DhKey* key, byte* out, word32* outSz);
|
|
||||||
WOLFSSL_LOCAL int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
|
|
||||||
#endif
|
|
||||||
WOLFSSL_LOCAL word32 SetBitString(word32 len, byte unusedBits, byte* output);
|
WOLFSSL_LOCAL word32 SetBitString(word32 len, byte unusedBits, byte* output);
|
||||||
WOLFSSL_LOCAL word32 SetImplicit(byte tag,byte number,word32 len,byte* output);
|
WOLFSSL_LOCAL word32 SetImplicit(byte tag,byte number,word32 len,byte* output);
|
||||||
WOLFSSL_LOCAL word32 SetExplicit(byte number, word32 len, byte* output);
|
WOLFSSL_LOCAL word32 SetExplicit(byte number, word32 len, byte* output);
|
||||||
@ -1154,14 +1256,20 @@ WOLFSSL_LOCAL int GetSerialNumber(const byte* input, word32* inOutIdx,
|
|||||||
byte* serial, int* serialSz, word32 maxIdx);
|
byte* serial, int* serialSz, word32 maxIdx);
|
||||||
WOLFSSL_LOCAL int GetNameHash(const byte* source, word32* idx, byte* hash,
|
WOLFSSL_LOCAL int GetNameHash(const byte* source, word32* idx, byte* hash,
|
||||||
int maxIdx);
|
int maxIdx);
|
||||||
WOLFSSL_LOCAL int wc_CheckPrivateKey(byte* key, word32 keySz, DecodedCert* der);
|
WOLFSSL_LOCAL int wc_CheckPrivateKeyCert(const byte* key, word32 keySz, DecodedCert* der);
|
||||||
|
WOLFSSL_LOCAL int wc_CheckPrivateKey(const byte* privKey, word32 privKeySz,
|
||||||
|
const byte* pubKey, word32 pubKeySz, enum Key_Sum ks);
|
||||||
WOLFSSL_LOCAL int StoreDHparams(byte* out, word32* outLen, mp_int* p, mp_int* g);
|
WOLFSSL_LOCAL int StoreDHparams(byte* out, word32* outLen, mp_int* p, mp_int* g);
|
||||||
WOLFSSL_LOCAL int FlattenAltNames( byte*, word32, const DNS_entry*);
|
WOLFSSL_LOCAL int FlattenAltNames( byte*, word32, const DNS_entry*);
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
#if defined(HAVE_ECC) || !defined(NO_DSA)
|
||||||
/* ASN sig helpers */
|
/* ASN sig helpers */
|
||||||
WOLFSSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
|
WOLFSSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
|
||||||
mp_int* s);
|
mp_int* s);
|
||||||
|
WOLFSSL_LOCAL int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen,
|
||||||
|
const byte* r, word32 rLen, const byte* s, word32 sLen);
|
||||||
|
WOLFSSL_LOCAL int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen,
|
||||||
|
byte* r, word32* rLen, byte* s, word32* sLen);
|
||||||
WOLFSSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
|
WOLFSSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
|
||||||
mp_int* r, mp_int* s);
|
mp_int* r, mp_int* s);
|
||||||
#endif
|
#endif
|
||||||
@ -1174,8 +1282,8 @@ WOLFSSL_LOCAL void FreeSignatureCtx(SignatureCtx* sigCtx);
|
|||||||
|
|
||||||
#ifndef NO_CERTS
|
#ifndef NO_CERTS
|
||||||
|
|
||||||
WOLFSSL_LOCAL int wc_EncryptedInfoParse(EncryptedInfo* info, char** pBuffer,
|
WOLFSSL_LOCAL int wc_EncryptedInfoParse(EncryptedInfo* info,
|
||||||
size_t bufSz);
|
const char** pBuffer, size_t bufSz);
|
||||||
|
|
||||||
WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type,
|
WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type,
|
||||||
DerBuffer** pDer, void* heap, EncryptedInfo* info,
|
DerBuffer** pDer, void* heap, EncryptedInfo* info,
|
||||||
@ -1185,6 +1293,17 @@ WOLFSSL_LOCAL void FreeDer(DerBuffer** der);
|
|||||||
|
|
||||||
#endif /* !NO_CERTS */
|
#endif /* !NO_CERTS */
|
||||||
|
|
||||||
|
#ifdef HAVE_SMIME
|
||||||
|
WOLFSSL_LOCAL int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** hdrs);
|
||||||
|
WOLFSSL_LOCAL int wc_MIME_header_strip(char* in, char** out, size_t start, size_t end);
|
||||||
|
WOLFSSL_LOCAL int wc_MIME_create_header(char* name, char* body, MimeHdr** hdr);
|
||||||
|
WOLFSSL_LOCAL int wc_MIME_create_parameter(char* attribute, char* value, MimeParam** param);
|
||||||
|
WOLFSSL_LOCAL MimeHdr* wc_MIME_find_header_name(const char* name, MimeHdr* hdr);
|
||||||
|
WOLFSSL_LOCAL MimeParam* wc_MIME_find_param_attr(const char* attribute, MimeParam* param);
|
||||||
|
WOLFSSL_LOCAL char* wc_MIME_canonicalize(const char* line);
|
||||||
|
WOLFSSL_LOCAL int wc_MIME_free_hdrs(MimeHdr* head);
|
||||||
|
#endif /* HAVE_SMIME */
|
||||||
|
|
||||||
#ifdef WOLFSSL_CERT_GEN
|
#ifdef WOLFSSL_CERT_GEN
|
||||||
|
|
||||||
enum cert_enums {
|
enum cert_enums {
|
||||||
@ -1200,7 +1319,8 @@ enum cert_enums {
|
|||||||
NTRU_KEY = 11,
|
NTRU_KEY = 11,
|
||||||
ECC_KEY = 12,
|
ECC_KEY = 12,
|
||||||
ED25519_KEY = 13,
|
ED25519_KEY = 13,
|
||||||
ED448_KEY = 14
|
ED448_KEY = 14,
|
||||||
|
DSA_KEY = 15
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* WOLFSSL_CERT_GEN */
|
#endif /* WOLFSSL_CERT_GEN */
|
||||||
@ -1251,6 +1371,9 @@ struct CertStatus {
|
|||||||
|
|
||||||
byte serial[EXTERNAL_SERIAL_SIZE];
|
byte serial[EXTERNAL_SERIAL_SIZE];
|
||||||
int serialSz;
|
int serialSz;
|
||||||
|
#ifdef OPENSSL_EXTRA
|
||||||
|
WOLFSSL_ASN1_INTEGER* serialInt;
|
||||||
|
#endif
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@ -1258,7 +1381,7 @@ struct CertStatus {
|
|||||||
byte nextDate[MAX_DATE_SIZE];
|
byte nextDate[MAX_DATE_SIZE];
|
||||||
byte thisDateFormat;
|
byte thisDateFormat;
|
||||||
byte nextDateFormat;
|
byte nextDateFormat;
|
||||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)
|
||||||
WOLFSSL_ASN1_TIME thisDateParsed;
|
WOLFSSL_ASN1_TIME thisDateParsed;
|
||||||
WOLFSSL_ASN1_TIME nextDateParsed;
|
WOLFSSL_ASN1_TIME nextDateParsed;
|
||||||
byte* thisDateAsn;
|
byte* thisDateAsn;
|
||||||
@ -1269,7 +1392,36 @@ struct CertStatus {
|
|||||||
word32 rawOcspResponseSz;
|
word32 rawOcspResponseSz;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct OcspEntry OcspEntry;
|
||||||
|
|
||||||
|
#ifdef NO_SHA
|
||||||
|
#define OCSP_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
|
||||||
|
#else
|
||||||
|
#define OCSP_DIGEST_SIZE WC_SHA_DIGEST_SIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct OcspEntry
|
||||||
|
{
|
||||||
|
OcspEntry *next; /* next entry */
|
||||||
|
word32 hashAlgoOID; /* hash algo ID */
|
||||||
|
byte issuerHash[OCSP_DIGEST_SIZE]; /* issuer hash */
|
||||||
|
byte issuerKeyHash[OCSP_DIGEST_SIZE]; /* issuer public key hash */
|
||||||
|
CertStatus *status; /* OCSP response list */
|
||||||
|
int totalStatus; /* number on list */
|
||||||
|
byte* rawCertId; /* raw bytes of the CertID */
|
||||||
|
int rawCertIdSize; /* num bytes in raw CertID */
|
||||||
|
/* option bits - using 32-bit for alignment */
|
||||||
|
word32 ownStatus:1; /* do we need to free the status
|
||||||
|
* response list */
|
||||||
|
word32 isDynamic:1; /* was dynamically allocated */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* TODO: Long-term, it would be helpful if we made this struct and other OCSP
|
||||||
|
structs conform to the ASN spec as described in RFC 6960. It will help
|
||||||
|
with readability and with implementing OpenSSL compatibility API
|
||||||
|
functions, because OpenSSL's OCSP data structures conform to the
|
||||||
|
RFC. */
|
||||||
struct OcspResponse {
|
struct OcspResponse {
|
||||||
int responseStatus; /* return code from Responder */
|
int responseStatus; /* return code from Responder */
|
||||||
|
|
||||||
@ -1279,8 +1431,6 @@ struct OcspResponse {
|
|||||||
byte producedDate[MAX_DATE_SIZE];
|
byte producedDate[MAX_DATE_SIZE];
|
||||||
/* Date at which this response was signed */
|
/* Date at which this response was signed */
|
||||||
byte producedDateFormat; /* format of the producedDate */
|
byte producedDateFormat; /* format of the producedDate */
|
||||||
byte* issuerHash;
|
|
||||||
byte* issuerKeyHash;
|
|
||||||
|
|
||||||
byte* cert;
|
byte* cert;
|
||||||
word32 certSz;
|
word32 certSz;
|
||||||
@ -1289,7 +1439,7 @@ struct OcspResponse {
|
|||||||
word32 sigSz; /* Length in octets for the sig */
|
word32 sigSz; /* Length in octets for the sig */
|
||||||
word32 sigOID; /* OID for hash used for sig */
|
word32 sigOID; /* OID for hash used for sig */
|
||||||
|
|
||||||
CertStatus* status; /* certificate status to fill out */
|
OcspEntry* single; /* chain of OCSP single responses */
|
||||||
|
|
||||||
byte* nonce; /* pointer to nonce inside ASN.1 response */
|
byte* nonce; /* pointer to nonce inside ASN.1 response */
|
||||||
int nonceSz; /* length of the nonce string */
|
int nonceSz; /* length of the nonce string */
|
||||||
@ -1300,6 +1450,7 @@ struct OcspResponse {
|
|||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
int verifyError;
|
int verifyError;
|
||||||
#endif
|
#endif
|
||||||
|
void* heap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1320,25 +1471,9 @@ struct OcspRequest {
|
|||||||
void* ssl;
|
void* ssl;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct OcspEntry OcspEntry;
|
WOLFSSL_LOCAL void InitOcspResponse(OcspResponse*, OcspEntry*, CertStatus*, byte*, word32, void*);
|
||||||
|
WOLFSSL_LOCAL void FreeOcspResponse(OcspResponse*);
|
||||||
#ifdef NO_SHA
|
WOLFSSL_LOCAL int OcspResponseDecode(OcspResponse*, void*, void* heap, int);
|
||||||
#define OCSP_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
|
|
||||||
#else
|
|
||||||
#define OCSP_DIGEST_SIZE WC_SHA_DIGEST_SIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct OcspEntry
|
|
||||||
{
|
|
||||||
OcspEntry *next; /* next entry */
|
|
||||||
byte issuerHash[OCSP_DIGEST_SIZE]; /* issuer hash */
|
|
||||||
byte issuerKeyHash[OCSP_DIGEST_SIZE]; /* issuer public key hash */
|
|
||||||
CertStatus *status; /* OCSP response list */
|
|
||||||
int totalStatus; /* number on list */
|
|
||||||
};
|
|
||||||
|
|
||||||
WOLFSSL_LOCAL void InitOcspResponse(OcspResponse*, CertStatus*, byte*, word32);
|
|
||||||
WOLFSSL_LOCAL int OcspResponseDecode(OcspResponse*, void*, void* heap, int);
|
|
||||||
|
|
||||||
WOLFSSL_LOCAL int InitOcspRequest(OcspRequest*, DecodedCert*, byte, void*);
|
WOLFSSL_LOCAL int InitOcspRequest(OcspRequest*, DecodedCert*, byte, void*);
|
||||||
WOLFSSL_LOCAL void FreeOcspRequest(OcspRequest*);
|
WOLFSSL_LOCAL void FreeOcspRequest(OcspRequest*);
|
||||||
@ -1416,12 +1551,13 @@ WOLFSSL_LOCAL void FreeDecodedCRL(DecodedCRL*);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum PBESTypes {
|
enum PBESTypes {
|
||||||
PBE_MD5_DES = 0,
|
PBE_MD5_DES = 0,
|
||||||
PBE_SHA1_RC4_128 = 1,
|
PBE_SHA1_RC4_128 = 1,
|
||||||
PBE_SHA1_DES = 2,
|
PBE_SHA1_DES = 2,
|
||||||
PBE_SHA1_DES3 = 3,
|
PBE_SHA1_DES3 = 3,
|
||||||
PBE_AES256_CBC = 4,
|
PBE_AES256_CBC = 4,
|
||||||
PBE_AES128_CBC = 5,
|
PBE_AES128_CBC = 5,
|
||||||
|
PBE_SHA1_40RC2_CBC = 6,
|
||||||
|
|
||||||
PBE_SHA1_RC4_128_SUM = 657,
|
PBE_SHA1_RC4_128_SUM = 657,
|
||||||
PBE_SHA1_DES3_SUM = 659,
|
PBE_SHA1_DES3_SUM = 659,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* asn_public.h
|
/* asn_public.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -32,6 +32,7 @@ This library defines the interface APIs for X509 certificates.
|
|||||||
#define WOLF_CRYPT_ASN_PUBLIC_H
|
#define WOLF_CRYPT_ASN_PUBLIC_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libwolfssl/wolfcrypt/types.h>
|
||||||
|
#include <libwolfssl/wolfcrypt/dsa.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -58,6 +59,10 @@ This library defines the interface APIs for X509 certificates.
|
|||||||
typedef struct WC_RNG WC_RNG;
|
typedef struct WC_RNG WC_RNG;
|
||||||
#define WC_RNG_TYPE_DEFINED
|
#define WC_RNG_TYPE_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef WC_DH_TYPE_DEFINED
|
||||||
|
typedef struct DhKey DhKey;
|
||||||
|
#define WC_DH_TYPE_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
enum Ecc_Sum {
|
enum Ecc_Sum {
|
||||||
ECC_SECP112R1_OID = 182,
|
ECC_SECP112R1_OID = 182,
|
||||||
@ -126,6 +131,7 @@ enum CertType {
|
|||||||
/* Signature type, by OID sum */
|
/* Signature type, by OID sum */
|
||||||
enum Ctc_SigType {
|
enum Ctc_SigType {
|
||||||
CTC_SHAwDSA = 517,
|
CTC_SHAwDSA = 517,
|
||||||
|
CTC_SHA256wDSA = 416,
|
||||||
CTC_MD2wRSA = 646,
|
CTC_MD2wRSA = 646,
|
||||||
CTC_MD5wRSA = 648,
|
CTC_MD5wRSA = 648,
|
||||||
CTC_SHAwRSA = 649,
|
CTC_SHAwRSA = 649,
|
||||||
@ -138,6 +144,17 @@ enum Ctc_SigType {
|
|||||||
CTC_SHA384wECDSA = 525,
|
CTC_SHA384wECDSA = 525,
|
||||||
CTC_SHA512wRSA = 657,
|
CTC_SHA512wRSA = 657,
|
||||||
CTC_SHA512wECDSA = 526,
|
CTC_SHA512wECDSA = 526,
|
||||||
|
|
||||||
|
/* https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration */
|
||||||
|
CTC_SHA3_224wECDSA = 423,
|
||||||
|
CTC_SHA3_256wECDSA = 424,
|
||||||
|
CTC_SHA3_384wECDSA = 425,
|
||||||
|
CTC_SHA3_512wECDSA = 426,
|
||||||
|
CTC_SHA3_224wRSA = 427,
|
||||||
|
CTC_SHA3_256wRSA = 428,
|
||||||
|
CTC_SHA3_384wRSA = 429,
|
||||||
|
CTC_SHA3_512wRSA = 430,
|
||||||
|
|
||||||
CTC_ED25519 = 256,
|
CTC_ED25519 = 256,
|
||||||
CTC_ED448 = 257
|
CTC_ED448 = 257
|
||||||
};
|
};
|
||||||
@ -331,7 +348,8 @@ typedef struct Cert {
|
|||||||
char certPolicies[CTC_MAX_CERTPOL_NB][CTC_MAX_CERTPOL_SZ];
|
char certPolicies[CTC_MAX_CERTPOL_NB][CTC_MAX_CERTPOL_SZ];
|
||||||
word16 certPoliciesNb; /* Number of Cert Policy */
|
word16 certPoliciesNb; /* Number of Cert Policy */
|
||||||
#endif
|
#endif
|
||||||
#if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA)
|
#if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
|
||||||
|
defined(WOLFSSL_CERT_REQ)
|
||||||
byte issRaw[sizeof(CertName)]; /* raw issuer info */
|
byte issRaw[sizeof(CertName)]; /* raw issuer info */
|
||||||
byte sbjRaw[sizeof(CertName)]; /* raw subject info */
|
byte sbjRaw[sizeof(CertName)]; /* raw subject info */
|
||||||
#endif
|
#endif
|
||||||
@ -467,7 +485,7 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
|
|||||||
|
|
||||||
#ifdef WOLFSSL_PEM_TO_DER
|
#ifdef WOLFSSL_PEM_TO_DER
|
||||||
WOLFSSL_API int wc_PemToDer(const unsigned char* buff, long longSz, int type,
|
WOLFSSL_API int wc_PemToDer(const unsigned char* buff, long longSz, int type,
|
||||||
DerBuffer** pDer, void* heap, EncryptedInfo* info, int* eccKey);
|
DerBuffer** pDer, void* heap, EncryptedInfo* info, int* keyFormat);
|
||||||
|
|
||||||
WOLFSSL_API int wc_KeyPemToDer(const unsigned char*, int,
|
WOLFSSL_API int wc_KeyPemToDer(const unsigned char*, int,
|
||||||
unsigned char*, int, const char*);
|
unsigned char*, int, const char*);
|
||||||
@ -507,6 +525,20 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
|
|||||||
WOLFSSL_API int wc_RsaPublicKeyDerSize(RsaKey* key, int with_header);
|
WOLFSSL_API int wc_RsaPublicKeyDerSize(RsaKey* key, int with_header);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_DSA
|
||||||
|
/* DSA parameter DER helper functions */
|
||||||
|
WOLFSSL_API int wc_DsaParamsDecode(const byte* input, word32* inOutIdx,
|
||||||
|
DsaKey*, word32);
|
||||||
|
WOLFSSL_API int wc_DsaKeyToParamsDer(DsaKey* key, byte* output, word32 inLen);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(NO_DH) && defined(WOLFSSL_DH_EXTRA)
|
||||||
|
WOLFSSL_LOCAL int wc_DhKeyToDer(DhKey* key, byte* output, word32* outSz, int exportPriv);
|
||||||
|
WOLFSSL_API int wc_DhParamsToDer(DhKey* key, byte* out, word32* outSz);
|
||||||
|
WOLFSSL_API int wc_DhPubKeyToDer(DhKey* key, byte* out, word32* outSz);
|
||||||
|
WOLFSSL_API int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
/* private key helpers */
|
/* private key helpers */
|
||||||
WOLFSSL_API int wc_EccPrivateKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_EccPrivateKeyDecode(const byte*, word32*,
|
||||||
@ -514,8 +546,11 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
|
|||||||
WOLFSSL_API int wc_EccKeyToDer(ecc_key*, byte* output, word32 inLen);
|
WOLFSSL_API int wc_EccKeyToDer(ecc_key*, byte* output, word32 inLen);
|
||||||
WOLFSSL_API int wc_EccPrivateKeyToDer(ecc_key* key, byte* output,
|
WOLFSSL_API int wc_EccPrivateKeyToDer(ecc_key* key, byte* output,
|
||||||
word32 inLen);
|
word32 inLen);
|
||||||
|
WOLFSSL_API int wc_EccKeyDerSize(ecc_key*, int pub);
|
||||||
WOLFSSL_API int wc_EccPrivateKeyToPKCS8(ecc_key* key, byte* output,
|
WOLFSSL_API int wc_EccPrivateKeyToPKCS8(ecc_key* key, byte* output,
|
||||||
word32* outLen);
|
word32* outLen);
|
||||||
|
WOLFSSL_API int wc_EccKeyToPKCS8(ecc_key* key, byte* output,
|
||||||
|
word32* outLen);
|
||||||
|
|
||||||
/* public key helper */
|
/* public key helper */
|
||||||
WOLFSSL_API int wc_EccPublicKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_EccPublicKeyDecode(const byte*, word32*,
|
||||||
@ -527,17 +562,24 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
|
|||||||
|
|
||||||
#ifdef HAVE_ED25519
|
#ifdef HAVE_ED25519
|
||||||
/* private key helpers */
|
/* private key helpers */
|
||||||
|
#ifdef HAVE_ED25519_KEY_IMPORT
|
||||||
WOLFSSL_API int wc_Ed25519PrivateKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_Ed25519PrivateKeyDecode(const byte*, word32*,
|
||||||
ed25519_key*, word32);
|
ed25519_key*, word32);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ED25519_KEY_EXPORT
|
||||||
WOLFSSL_API int wc_Ed25519KeyToDer(ed25519_key* key, byte* output,
|
WOLFSSL_API int wc_Ed25519KeyToDer(ed25519_key* key, byte* output,
|
||||||
word32 inLen);
|
word32 inLen);
|
||||||
WOLFSSL_API int wc_Ed25519PrivateKeyToDer(ed25519_key* key, byte* output,
|
WOLFSSL_API int wc_Ed25519PrivateKeyToDer(ed25519_key* key, byte* output,
|
||||||
word32 inLen);
|
word32 inLen);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* public key helper */
|
/* public key helper */
|
||||||
WOLFSSL_API int wc_Ed25519PublicKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_Ed25519PublicKeyDecode(const byte*, word32*,
|
||||||
ed25519_key*, word32);
|
ed25519_key*, word32);
|
||||||
#if (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
#if (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN)) && \
|
||||||
|
defined(HAVE_ED25519_KEY_EXPORT)
|
||||||
|
|
||||||
WOLFSSL_API int wc_Ed25519PublicKeyToDer(ed25519_key*, byte* output,
|
WOLFSSL_API int wc_Ed25519PublicKeyToDer(ed25519_key*, byte* output,
|
||||||
word32 inLen, int with_AlgCurve);
|
word32 inLen, int with_AlgCurve);
|
||||||
#endif
|
#endif
|
||||||
@ -545,17 +587,23 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
|
|||||||
|
|
||||||
#ifdef HAVE_ED448
|
#ifdef HAVE_ED448
|
||||||
/* private key helpers */
|
/* private key helpers */
|
||||||
|
#ifdef HAVE_ED448_KEY_IMPORT
|
||||||
WOLFSSL_API int wc_Ed448PrivateKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_Ed448PrivateKeyDecode(const byte*, word32*,
|
||||||
ed448_key*, word32);
|
ed448_key*, word32);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ED448_KEY_EXPORT
|
||||||
WOLFSSL_API int wc_Ed448KeyToDer(ed448_key* key, byte* output,
|
WOLFSSL_API int wc_Ed448KeyToDer(ed448_key* key, byte* output,
|
||||||
word32 inLen);
|
word32 inLen);
|
||||||
WOLFSSL_API int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output,
|
WOLFSSL_API int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output,
|
||||||
word32 inLen);
|
word32 inLen);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* public key helper */
|
/* public key helper */
|
||||||
WOLFSSL_API int wc_Ed448PublicKeyDecode(const byte*, word32*,
|
WOLFSSL_API int wc_Ed448PublicKeyDecode(const byte*, word32*,
|
||||||
ed448_key*, word32);
|
ed448_key*, word32);
|
||||||
#if (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
#if (defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN)) && \
|
||||||
|
defined(HAVE_ED448_KEY_EXPORT)
|
||||||
WOLFSSL_API int wc_Ed448PublicKeyToDer(ed448_key*, byte* output,
|
WOLFSSL_API int wc_Ed448PublicKeyToDer(ed448_key*, byte* output,
|
||||||
word32 inLen, int with_AlgCurve);
|
word32 inLen, int with_AlgCurve);
|
||||||
#endif
|
#endif
|
||||||
@ -569,7 +617,13 @@ WOLFSSL_API int wc_GetCTC_HashOID(int type);
|
|||||||
WOLFSSL_API int wc_GetPkcs8TraditionalOffset(byte* input,
|
WOLFSSL_API int wc_GetPkcs8TraditionalOffset(byte* input,
|
||||||
word32* inOutIdx, word32 sz);
|
word32* inOutIdx, word32 sz);
|
||||||
WOLFSSL_API int wc_CreatePKCS8Key(byte* out, word32* outSz,
|
WOLFSSL_API int wc_CreatePKCS8Key(byte* out, word32* outSz,
|
||||||
byte* key, word32 keySz, int algoID, const byte* curveOID, word32 oidSz);
|
byte* key, word32 keySz, int algoID, const byte* curveOID,
|
||||||
|
word32 oidSz);
|
||||||
|
WOLFSSL_API int wc_EncryptPKCS8Key(byte*, word32, byte*, word32*, const char*,
|
||||||
|
int, int, int, int, byte*, word32, int, WC_RNG*, void*);
|
||||||
|
WOLFSSL_API int wc_DecryptPKCS8Key(byte*, word32, const char*, int);
|
||||||
|
WOLFSSL_API int wc_CreateEncryptedPKCS8Key(byte*, word32, byte*, word32*,
|
||||||
|
const char*, int, int, int, int, byte*, word32, int, WC_RNG*, void*);
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
#ifndef NO_ASN_TIME
|
||||||
/* Time */
|
/* Time */
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
/* blake2-impl.h
|
/* blake2-impl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -36,7 +36,7 @@
|
|||||||
#ifndef WOLFCRYPT_BLAKE2_IMPL_H
|
#ifndef WOLFCRYPT_BLAKE2_IMPL_H
|
||||||
#define WOLFCRYPT_BLAKE2_IMPL_H
|
#define WOLFCRYPT_BLAKE2_IMPL_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
static WC_INLINE word32 load32( const void *src )
|
static WC_INLINE word32 load32( const void *src )
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ static WC_INLINE void store32( void *dst, word32 w )
|
|||||||
|
|
||||||
static WC_INLINE void store64( void *dst, word64 w )
|
static WC_INLINE void store64( void *dst, word64 w )
|
||||||
{
|
{
|
||||||
#if defined(LITTLE_ENDIAN_ORDER)
|
#if defined(LITTLE_ENDIAN_ORDER) && !defined(WOLFSSL_GENERAL_ALIGNMENT)
|
||||||
*( word64 * )( dst ) = w;
|
*( word64 * )( dst ) = w;
|
||||||
#else
|
#else
|
||||||
byte *p = ( byte * )dst;
|
byte *p = ( byte * )dst;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
/* blake2-int.h
|
/* blake2-int.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -37,7 +37,7 @@
|
|||||||
#ifndef WOLFCRYPT_BLAKE2_INT_H
|
#ifndef WOLFCRYPT_BLAKE2_INT_H
|
||||||
#define WOLFCRYPT_BLAKE2_INT_H
|
#define WOLFCRYPT_BLAKE2_INT_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -77,7 +77,7 @@
|
|||||||
byte personal[BLAKE2S_PERSONALBYTES]; /* 32 */
|
byte personal[BLAKE2S_PERSONALBYTES]; /* 32 */
|
||||||
} blake2s_param;
|
} blake2s_param;
|
||||||
|
|
||||||
ALIGN32 typedef struct __blake2s_state
|
typedef struct ALIGN32 __blake2s_state
|
||||||
{
|
{
|
||||||
word32 h[8];
|
word32 h[8];
|
||||||
word32 t[2];
|
word32 t[2];
|
||||||
@ -102,7 +102,7 @@
|
|||||||
byte personal[BLAKE2B_PERSONALBYTES]; /* 64 */
|
byte personal[BLAKE2B_PERSONALBYTES]; /* 64 */
|
||||||
} blake2b_param;
|
} blake2b_param;
|
||||||
|
|
||||||
ALIGN64 typedef struct __blake2b_state
|
typedef struct ALIGN64 __blake2b_state
|
||||||
{
|
{
|
||||||
word64 h[8];
|
word64 h[8];
|
||||||
word64 t[2];
|
word64 t[2];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* blake2.h
|
/* blake2.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -26,11 +26,11 @@
|
|||||||
#ifndef WOLF_CRYPT_BLAKE2_H
|
#ifndef WOLF_CRYPT_BLAKE2_H
|
||||||
#define WOLF_CRYPT_BLAKE2_H
|
#define WOLF_CRYPT_BLAKE2_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/settings.h>
|
#include <libs/libwolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
|
#if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/blake2-int.h>
|
#include <libs/libwolfssl/wolfcrypt/blake2-int.h>
|
||||||
|
|
||||||
/* call old functions if using fips for the sake of hmac @wc_fips */
|
/* call old functions if using fips for the sake of hmac @wc_fips */
|
||||||
#ifdef HAVE_FIPS
|
#ifdef HAVE_FIPS
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
/* camellia.h
|
/* camellia.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2021 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL.
|
* This file is part of wolfSSL.
|
||||||
*
|
*
|
||||||
@ -54,7 +54,7 @@
|
|||||||
#ifndef WOLF_CRYPT_CAMELLIA_H
|
#ifndef WOLF_CRYPT_CAMELLIA_H
|
||||||
#define WOLF_CRYPT_CAMELLIA_H
|
#define WOLF_CRYPT_CAMELLIA_H
|
||||||
|
|
||||||
#include <libwolfssl/wolfcrypt/types.h>
|
#include <libs/libwolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_CAMELLIA
|
#ifdef HAVE_CAMELLIA
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user