Пример #1
0
int sslAccept(SSL *ssl)
{
  while(true) {
    int ret = SSL_accept(ssl);
    if (ret >= 0) {
      return ret;
    } else {
      ret = sslWait(ssl,ret,"Accept");
      if (ret < 0) return ret;
    }
  }
}
Пример #2
0
int sslDoHandshake(SSL *ssl)
{
  while(true) {
    int ret = SSL_do_handshake(ssl);
    if (ret > 0) {
      return ret;
    } else {
      ret = sslWait(ssl,ret,"Handshake");
      if (ret < 0) return ret;
    }
  }
}
Пример #3
0
int sslConnect(SSL *ssl)
{
    while(true) {
        int ret = SSL_connect(ssl);
        if (ret >= 0) {
            return ret;
        } else {
            ret = sslWait(ssl,ret,"Connect");
            if (ret < 0) return ret;
        }
    }
}
Пример #4
0
int sslShutdown(SSL *ssl)
{
  //assert(!SSL_renegotiate_pending(ssl));
  while (true) {
    int ret = SSL_shutdown(ssl);
    if (ret >= 0) {
      return ret;
    } else {
      ret = sslWait(ssl,ret,"Shutdown");
      if (ret < 0) {
	return ret;
      }
    }
  }
}
Пример #5
0
int sslConnect(SSL *ssl)
{
  while(true) {
    int ret = SSL_connect(ssl);
    if (ret >= 0) {
      return ret;
    } else {
      ret = sslWait(ssl,ret,"Connect");
      // It would seem that connect can return EAGAIN...
      if ((SSL_get_error(ssl,ret) != SSL_ERROR_SYSCALL || errno != EAGAIN) && ret < 0) {
        return ret;
      }
    }
  }
}