// RevocationBucket is the bolt bucket to store revocation data in
RevocationBucket="revocations"
)
var(
// AllHandlers holds all registered extension handlers
AllHandlersHandlerFactories
// CAWhitelistSignedLeafHandler verifies that the leaf cert of the remote peer's
// identity was signed by one of the CA certs in the whitelist.
CAWhitelistSignedLeafHandler=NewHandlerFactory(
&SignedCertExtID,caWhitelistSignedLeafHandler,
)
// NB: 2.999.X is reserved for "example" OIDs
// (see http://oid-info.com/get/2.999)
// 2.999.1.X -- storj general/misc. extensions
// SignedCertExtID is the asn1 object ID for a pkix extensionHandler holding a
// signature of the cert it's extending, signed by some CA (e.g. the root cert chain).
// This extensionHandler allows for an additional signature per certificate.
SignedCertExtID=ExtensionID{2,999,1,1}
// RevocationExtID is the asn1 object ID for a pkix extensionHandler containing the
// most recent certificate revocation data
// for the current TLS cert chain.
RevocationExtID=ExtensionID{2,999,1,2}
// Error is used when an error occurs while processing an extension.
Error=errs.Class("extension error")
// ErrVerifyCASignedLeaf is used when a signed leaf extension signature wasn't produced
// by any CA in the whitelist.
ErrVerifyCASignedLeaf=Error.New("leaf not signed by any CA in the whitelist")
// ErrUniqueExtensions is used when multiple extensions have the same Id
ErrUniqueExtensions=Error.New("extensions are not unique")
)
// ExtensionID is an alias to an `asn1.ObjectIdentifier`.
typeExtensionID=asn1.ObjectIdentifier
// Config is used to bind cli flags for determining which extensions will
// be used by the server
typeConfigstruct{
Revocationbool`default:"true" help:"if true, client leaves may contain the most recent certificate revocation for the current certificate"`
WhitelistSignedLeafbool`default:"false" help:"if true, client leaves must contain a valid \"signed certificate extension\" (NB: verified against certs in the peer ca whitelist; i.e. if true, a whitelist must be provided)"`
}
// Options holds common options for use in handling extensions.
typeOptionsstruct{
PeerCAWhitelist[]*x509.Certificate
RevDBRevocationDB
}
// HandlerFactories is a collection of `HandlerFactory`s for convenience.
// Defines `Register` and `WithOptions` methods.
typeHandlerFactories[]*HandlerFactory
// HandlerFactory holds a factory for a handler function given the passed `Options`.
// For use in handling extensions with the corresponding ExtensionID.
typeHandlerFactorystruct{
id*ExtensionID
factoryHandlerFactoryFunc
}
// HandlerFactoryFunc is a factory function used to build `HandlerFunc`s given