1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Compile failure fix with FS_NO_GLOBALS flag (#7685)

This commit is contained in:
isadora-6th 2020-10-30 03:11:57 +03:00 committed by GitHub
parent 77bd71ec29
commit 996211f132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,7 @@ CertStore::CertInfo CertStore::_preprocessCert(uint32_t length, uint32_t offset,
// The certs.ar file is a UNIX ar format file, concatenating all the
// individual certificates into a single blob in a space-efficient way.
int CertStore::initCertStore(FS &fs, const char *indexFileName, const char *dataFileName) {
int CertStore::initCertStore(fs::FS &fs, const char *indexFileName, const char *dataFileName) {
int count = 0;
uint32_t offset = 0;
@ -101,12 +101,12 @@ int CertStore::initCertStore(FS &fs, const char *indexFileName, const char *data
memcpy_P(_indexName, indexFileName, strlen_P(indexFileName) + 1);
memcpy_P(_dataName, dataFileName, strlen_P(dataFileName) + 1);
File index = _fs->open(_indexName, "w");
fs::File index = _fs->open(_indexName, "w");
if (!index) {
return 0;
}
File data = _fs->open(_dataName, "r");
fs::File data = _fs->open(_dataName, "r");
if (!data) {
index.close();
return 0;
@ -179,7 +179,7 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn,
return nullptr;
}
File index = cs->_fs->open(cs->_indexName, "r");
fs::File index = cs->_fs->open(cs->_indexName, "r");
if (!index) {
return nullptr;
}
@ -191,12 +191,12 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn,
if (!der) {
return nullptr;
}
File data = cs->_fs->open(cs->_dataName, "r");
fs::File data = cs->_fs->open(cs->_dataName, "r");
if (!data) {
free(der);
return nullptr;
}
if (!data.seek(ci.offset, SeekSet)) {
if (!data.seek(ci.offset, fs::SeekSet)) {
data.close();
free(der);
return nullptr;