changed enum to enum class and made names globally more consistent for RsEvents

This commit is contained in:
csoler 2019-12-17 21:41:21 +01:00
parent d7504c59b5
commit 3d7ae59df7
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
21 changed files with 155 additions and 151 deletions

View file

@ -1222,7 +1222,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
ev->mSslId = sslId;
ev->mPgpId = pgpId;
ev->mErrorMsg = errMsg;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
rsEvents->postEvent(std::move(ev));
}
@ -1242,7 +1242,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
ev->mSslId = sslId;
ev->mSslCn = sslCn;
ev->mErrorMsg = errMsg;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
rsEvents->postEvent(std::move(ev));
}
@ -1273,7 +1273,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
ev->mSslCn = sslCn;
ev->mPgpId = pgpId;
ev->mErrorMsg = errorMsg;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISMATCHED_PGP_ID;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISMATCHED_PGP_ID;
rsEvents->postEvent(std::move(ev));
}
@ -1301,10 +1301,10 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
switch(auth_diagnostic)
{
case RS_SSL_HANDSHAKE_DIAGNOSTIC_ISSUER_UNKNOWN: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::NOT_A_FRIEND; break;
case RS_SSL_HANDSHAKE_DIAGNOSTIC_WRONG_SIGNATURE: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::PGP_SIGNATURE_VALIDATION_FAILED;break;
case RS_SSL_HANDSHAKE_DIAGNOSTIC_ISSUER_UNKNOWN: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NOT_A_FRIEND; break;
case RS_SSL_HANDSHAKE_DIAGNOSTIC_WRONG_SIGNATURE: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PGP_SIGNATURE_VALIDATION_FAILED;break;
default:
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;break;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;break;
}
ev->mErrorMsg = errMsg;
@ -1331,7 +1331,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
ev->mSslCn = sslCn;
ev->mPgpId = pgpId;
ev->mErrorMsg = errMsg;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::NOT_A_FRIEND;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NOT_A_FRIEND;
rsEvents->postEvent(std::move(ev));
}

View file

@ -477,7 +477,7 @@ void p3LinkMgrIMPL::tickMonitors()
{
auto e = std::make_shared<RsConnectionEvent>() ;
e->mConnectionInfoCode = RsConnectionEvent::PEER_CONNECTED;
e->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_CONNECTED;
e->mSslId = peer.id;
rsEvents->postEvent(e);
@ -486,7 +486,7 @@ void p3LinkMgrIMPL::tickMonitors()
{
auto e = std::make_shared<RsConnectionEvent>() ;
e->mConnectionInfoCode = RsConnectionEvent::PEER_DISCONNECTED;
e->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_DISCONNECTED;
e->mSslId = peer.id;
rsEvents->postEvent(e);

View file

@ -1814,7 +1814,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons
ev->mSslId = from;
ev->mStrInfo1 = sockaddr_storage_iptostring(addr);
ev->mStrInfo2 = sockaddr_storage_iptostring(own_addr);
ev->mConnectionInfoCode = RsConnectionEvent::PEER_REPORTS_WRONG_IP;
ev->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_REPORTS_WRONG_IP;
rsEvents->postEvent(ev);
}

View file

@ -1114,7 +1114,7 @@ int pqissl::SSL_Connection_Complete()
X509 *x509 = SSL_get_peer_certificate(ssl_connection) ;
ev->mSslId = RsX509Cert::getCertSslId(*x509);
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::PEER_REFUSED_CONNECTION;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PEER_REFUSED_CONNECTION;
rsEvents->postEvent(ev);
}
@ -1283,7 +1283,7 @@ int pqissl::accept_locked( SSL *ssl, int fd,
ev->mSslId = RsX509Cert::getCertSslId(*x509);
ev->mLocator = RsUrl(foreign_addr);
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::IP_IS_BLACKLISTED;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::IP_IS_BLACKLISTED;
rsEvents->postEvent(ev);
}

View file

@ -483,7 +483,7 @@ int pqissllistenbase::continueSSL(IncomingSSLInfo& incoming_connexion_info, bool
auto ev = std::unique_ptr<RsAuthSslConnectionAutenticationEvent>(new RsAuthSslConnectionAutenticationEvent);
ev->mLocator = RsUrl(incoming_connexion_info.addr);
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
rsEvents->postEvent(std::move(ev));
}