removing non-existing file from the build
[folly.git] / folly / wangle / ssl / PasswordInFile.cpp
1 /*
2  *  Copyright (c) 2015, Facebook, Inc.
3  *  All rights reserved.
4  *
5  *  This source code is licensed under the BSD-style license found in the
6  *  LICENSE file in the root directory of this source tree. An additional grant
7  *  of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #include <folly/wangle/ssl/PasswordInFile.h>
11
12 #include <folly/FileUtil.h>
13
14 using namespace std;
15
16 namespace folly {
17
18 PasswordInFile::PasswordInFile(const string& file)
19     : fileName_(file) {
20   folly::readFile(file.c_str(), password_);
21   auto p = password_.find('\0');
22   if (p != std::string::npos) {
23     password_.erase(p);
24   }
25 }
26
27 PasswordInFile::~PasswordInFile() {
28   OPENSSL_cleanse((char *)password_.data(), password_.length());
29 }
30
31 }