proxygen
|
#include <SecondaryAuthManager.h>
Public Member Functions | |
SecondaryAuthManager (std::unique_ptr< fizz::SelfCert > cert) | |
SecondaryAuthManager ()=default | |
~SecondaryAuthManager () override | |
std::pair< uint16_t, std::unique_ptr< folly::IOBuf > > | createAuthRequest (std::unique_ptr< folly::IOBuf > certRequestContext, std::vector< fizz::Extension > extensions) override |
std::pair< uint16_t, std::unique_ptr< folly::IOBuf > > | getAuthenticator (const fizz::AsyncFizzBase &transport, TransportDirection dir, uint16_t requestId, std::unique_ptr< folly::IOBuf > authRequest) override |
bool | validateAuthenticator (const fizz::AsyncFizzBase &transport, TransportDirection dir, uint16_t certId, std::unique_ptr< folly::IOBuf > authenticator) override |
folly::Optional< uint16_t > | getCertId (uint16_t requestId) |
folly::Optional< std::vector< fizz::CertificateEntry > > | getPeerCert (uint16_t certId) |
Public Member Functions inherited from proxygen::SecondaryAuthManagerBase | |
virtual | ~SecondaryAuthManagerBase ()=default |
Private Member Functions | |
folly::Optional< std::unique_ptr< folly::IOBuf > > | verifyContext (std::unique_ptr< folly::IOBuf > authenticator) |
Private Attributes | |
uint16_t | requestIdCounter_ {0} |
uint16_t | certIdCounter_ {0} |
std::map< uint16_t, std::unique_ptr< folly::IOBuf > > | outstandingRequests_ |
std::unique_ptr< fizz::SelfCert > | cert_ |
std::map< uint16_t, uint16_t > | requestCertMap_ |
std::map< uint16_t, std::vector< fizz::CertificateEntry > > | receivedCerts_ |
Definition at line 16 of file SecondaryAuthManager.h.
|
explicit |
Definition at line 18 of file SecondaryAuthManager.cpp.
References folly::gen::move.
|
default |
|
override |
Definition at line 23 of file SecondaryAuthManager.cpp.
|
overridevirtual |
Generate an authenticator request given a certificate_request_context and a set of extensions.
Implements proxygen::SecondaryAuthManagerBase.
Reimplemented in proxygen::MockSecondaryAuthManager.
Definition at line 27 of file SecondaryAuthManager.cpp.
References folly::IOBufQueue::cacheChainLength(), folly::IOBuf::computeChainDataLength(), fizz::ExportedAuthenticator::getAuthenticatorRequest(), folly::gen::move, uint16_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by TEST().
|
overridevirtual |
Generate an authenticator request given the Request-ID and authenticator request..
Implements proxygen::SecondaryAuthManagerBase.
Reimplemented in proxygen::MockSecondaryAuthManager.
Definition at line 48 of file SecondaryAuthManager.cpp.
References fizz::DOWNSTREAM, fizz::ExportedAuthenticator::getAuthenticator(), folly::gen::move, uint16_t, and fizz::UPSTREAM.
Referenced by TEST().
folly::Optional< uint16_t > proxygen::SecondaryAuthManager::getCertId | ( | uint16_t | requestId | ) |
Retrieve a Cert-ID given the corresponding Request-ID.
Definition at line 122 of file SecondaryAuthManager.cpp.
References folly::none.
Referenced by TEST().
folly::Optional< std::vector< fizz::CertificateEntry > > proxygen::SecondaryAuthManager::getPeerCert | ( | uint16_t | certId | ) |
Retrieve the peer certificate chain given the corresponding Cert-ID.
Definition at line 132 of file SecondaryAuthManager.cpp.
References folly::gen::move, and folly::none.
Referenced by TEST().
|
overridevirtual |
Validate an authenticator and cache the received certificate along with the Cert-ID if it is valid.
Implements proxygen::SecondaryAuthManagerBase.
Reimplemented in proxygen::MockSecondaryAuthManager.
Definition at line 66 of file SecondaryAuthManager.cpp.
References folly::IOBuf::clone(), fizz::DOWNSTREAM, folly::gen::move, fizz::UPSTREAM, and fizz::ExportedAuthenticator::validateAuthenticator().
Referenced by TEST().
|
private |
Verify if the certificate_request_context of the authenticator contains a Request-ID of a previous CERTIFICATE_REQUEST.
authenticator | The received exported authenticator. |
Definition at line 105 of file SecondaryAuthManager.cpp.
References fizz::ExportedAuthenticator::getAuthenticatorContext(), folly::gen::move, folly::none, and uint16_t.
|
private |
Definition at line 69 of file SecondaryAuthManager.h.
|
private |
Definition at line 53 of file SecondaryAuthManager.h.
|
private |
Definition at line 66 of file SecondaryAuthManager.h.
|
private |
Definition at line 77 of file SecondaryAuthManager.h.
Definition at line 73 of file SecondaryAuthManager.h.
|
private |
Definition at line 52 of file SecondaryAuthManager.h.