Refreshing TLS files was done to an incorrect location that resulted in random memory being wiped out. Also fixed a typo that loaded the key bytes into the CA bytes in some cases.

This commit is contained in:
A.J. Beamon 2020-06-12 14:40:10 -07:00
parent cc10aef548
commit 6f4d6f1923
1 changed files with 2 additions and 2 deletions

View File

@ -287,7 +287,7 @@ ACTOR static Future<Void> readEntireFile( std::string filename, std::string* des
throw file_too_large();
}
destination->resize(filesize);
wait(success(file->read(&destination[0], filesize, 0)));
wait(success(file->read(&((*destination)[0]), filesize, 0)));
return Void();
}
@ -313,7 +313,7 @@ ACTOR Future<LoadedTLSConfig> TLSConfig::loadAsync(const TLSConfig* self) {
if (CAPath.size()) {
reads.push_back( readEntireFile( CAPath, &loaded.tlsCABytes ) );
} else {
loaded.tlsCABytes = self->tlsKeyBytes;
loaded.tlsCABytes = self->tlsCABytes;
}
wait(waitForAll(reads));