#include <boost/noncopyable.hpp>
#include <errno.h>
#include <fcntl.h>
-#include <openssl/err.h>
-#include <openssl/asn1.h>
-#include <openssl/ssl.h>
#include <sys/types.h>
#include <chrono>
return 0;
}
BIO* next = BIO_next(b);
- while (next != NULL) {
+ while (next != nullptr) {
b = next;
next = BIO_next(b);
}
assert(sslState_ == STATE_UNINIT);
noTransparentTls_ = true;
totalConnectTimeout_ = totalConnectTimeout;
- AsyncSSLSocketConnector* connector =
- new AsyncSSLSocketConnector(this, callback, totalConnectTimeout.count());
+ AsyncSSLSocketConnector* connector = new AsyncSSLSocketConnector(
+ this, callback, int(totalConnectTimeout.count()));
AsyncSocket::connect(
- connector, address, connectTimeout.count(), options, bindAddr);
+ connector, address, int(connectTimeout.count()), options, bindAddr);
}
bool AsyncSSLSocket::needsPeerVerification() const {
// The timeout (if set) keeps running here
return true;
#endif
- } else if (0
+ } else if ((0
#ifdef SSL_ERROR_WANT_RSA_ASYNC_PENDING
|| error == SSL_ERROR_WANT_RSA_ASYNC_PENDING
#endif
#ifdef SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
|| error == SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
#endif
- ) {
+ )) {
// Our custom openssl function has kicked off an async request to do
// rsa/ecdsa private key operation. When that call returns, a callback will
// be invoked that will re-call handleAccept.
<< "): client intitiated SSL renegotiation not permitted";
return ReadResult(
READ_ERROR,
- folly::make_unique<SSLException>(SSLError::CLIENT_RENEGOTIATION));
+ std::make_unique<SSLException>(SSLError::CLIENT_RENEGOTIATION));
}
if (bytes <= 0) {
int error = SSL_get_error(ssl_, bytes);
<< "): unsupported SSL renegotiation during read";
return ReadResult(
READ_ERROR,
- folly::make_unique<SSLException>(SSLError::INVALID_RENEGOTIATION));
+ std::make_unique<SSLException>(SSLError::INVALID_RENEGOTIATION));
} else {
if (zero_return(error, bytes)) {
return ReadResult(bytes);
<< "reason: " << ERR_reason_error_string(errError);
return ReadResult(
READ_ERROR,
- folly::make_unique<SSLException>(error, errError, bytes, errno));
+ std::make_unique<SSLException>(error, errError, bytes, errno));
}
} else {
appBytesReceived_ += bytes;
<< "unsupported SSL renegotiation during write";
return WriteResult(
WRITE_ERROR,
- folly::make_unique<SSLException>(SSLError::INVALID_RENEGOTIATION));
+ std::make_unique<SSLException>(SSLError::INVALID_RENEGOTIATION));
} else {
if (zero_return(error, rc)) {
return WriteResult(0);
<< ", reason: " << ERR_reason_error_string(errError);
return WriteResult(
WRITE_ERROR,
- folly::make_unique<SSLException>(error, errError, rc, errno));
+ std::make_unique<SSLException>(error, errError, rc, errno));
}
}
<< "TODO: AsyncSSLSocket currently does not support calling "
<< "write() before the handshake has fully completed";
return WriteResult(
- WRITE_ERROR, folly::make_unique<SSLException>(SSLError::EARLY_WRITE));
+ WRITE_ERROR, std::make_unique<SSLException>(SSLError::EARLY_WRITE));
}
// Declare a buffer used to hold small write requests. It could point to a
queue.append(std::move(sslSock->preReceivedData_));
queue.trimStart(len);
sslSock->preReceivedData_ = queue.move();
- return len;
+ return static_cast<int>(len);
} else {
- auto result = recv(OpenSSLUtils::getBioFd(b, nullptr), out, outl, 0);
+ auto result = int(recv(OpenSSLUtils::getBioFd(b, nullptr), out, outl, 0));
if (result <= 0 && OpenSSLUtils::getBioShouldRetryWrite(result)) {
BIO_set_retry_read(b);
}