@@ -1426,7 +1426,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
14261426
14271427 RsInfo () << __PRETTY_FUNCTION__ << " " << errMsg << std::endl;
14281428
1429- if (rsEvents)
1429+ if (rsEvents && ! isNotifyDenied (pgpId) )
14301430 {
14311431 ev->mSslId = sslId;
14321432 ev->mSslCn = sslCn;
@@ -1467,7 +1467,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
14671467
14681468 Dbg1 () << __PRETTY_FUNCTION__ << " " << errMsg << std::endl;
14691469
1470- if (rsEvents)
1470+ if (rsEvents && ! isNotifyDenied (pgpId) )
14711471 {
14721472 ev->mSslId = sslId;
14731473 ev->mSslCn = sslCn;
@@ -1874,6 +1874,18 @@ bool AuthSSLimpl::saveList(bool& cleanup, std::list<RsItem*>& lst)
18741874 }
18751875 lst.push_back (vitem);
18761876
1877+ /* Save Deny List */
1878+ if (!mDenyList .empty ()) {
1879+ RsConfigKeyValueSet* denyItem = new RsConfigKeyValueSet;
1880+ for (const auto & pair : mDenyList ) {
1881+ RsTlvKeyValue kv;
1882+ kv.key = pair.first .toStdString ();
1883+ kv.value = " DENY:" + pair.second ;
1884+ denyItem->tlvkvs .pairs .push_back (kv);
1885+ }
1886+ lst.push_back (denyItem);
1887+ }
1888+
18771889 return true ;
18781890}
18791891
@@ -1903,6 +1915,11 @@ bool AuthSSLimpl::loadList(std::list<RsItem*>& load)
19031915 continue ;
19041916 }
19051917
1918+ if (kit->value .compare (0 , 5 , " DENY:" ) == 0 ) {
1919+ mDenyList [RsPgpId (kit->key )] = kit->value .substr (5 );
1920+ continue ;
1921+ }
1922+
19061923 X509 *peer = loadX509FromPEM (kit->value );
19071924 /* authenticate it */
19081925 uint32_t diagnos ;
@@ -1918,6 +1935,32 @@ bool AuthSSLimpl::loadList(std::list<RsItem*>& load)
19181935 return true ;
19191936}
19201937
1938+ void AuthSSLimpl::addNotifyDeny (const RsPgpId& pgpId, const std::string& name)
1939+ {
1940+ RsStackMutex stack (sslMtx);
1941+ mDenyList [pgpId] = name;
1942+ IndicateConfigChanged ();
1943+ }
1944+
1945+ void AuthSSLimpl::removeNotifyDeny (const RsPgpId& pgpId)
1946+ {
1947+ RsStackMutex stack (sslMtx);
1948+ mDenyList .erase (pgpId);
1949+ IndicateConfigChanged ();
1950+ }
1951+
1952+ bool AuthSSLimpl::isNotifyDenied (const RsPgpId& pgpId)
1953+ {
1954+ RsStackMutex stack (sslMtx);
1955+ return mDenyList .find (pgpId) != mDenyList .end ();
1956+ }
1957+
1958+ void AuthSSLimpl::getNotifyDenyList (std::map<RsPgpId, std::string>& ids)
1959+ {
1960+ RsStackMutex stack (sslMtx);
1961+ ids = mDenyList ;
1962+ }
1963+
19211964const EVP_PKEY*RsX509Cert::getPubKey (const X509& x509)
19221965{
19231966#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
0 commit comments