| 356 | } |
| 357 | |
| 358 | Status GetPasswordFromShellCommand(const string& cmd, string* password) { |
| 359 | vector<string> argv = strings::Split(cmd, " ", strings::SkipEmpty()); |
| 360 | if (argv.empty()) { |
| 361 | return Status::RuntimeError("invalid empty private key password command"); |
| 362 | } |
| 363 | string stderr, stdout; |
| 364 | Status s = Subprocess::Call(argv, "" /* stdin */, &stdout, &stderr); |
| 365 | if (!s.ok()) { |
| 366 | return Status::RuntimeError(strings::Substitute( |
| 367 | "failed to run private key password command: $0", s.ToString()), stderr); |
| 368 | } |
| 369 | StripTrailingWhitespace(&stdout); |
| 370 | *password = stdout; |
| 371 | return Status::OK(); |
| 372 | } |
| 373 | |
| 374 | string GetProtocolName(const SSL* ssl) { |
| 375 | SCOPED_OPENSSL_NO_PENDING_ERRORS; |
no test coverage detected