id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
31,000
letsencrypt/boulder
sa/sa.go
CountRegistrationsByIP
func (ssa *SQLStorageAuthority) CountRegistrationsByIP(ctx context.Context, ip net.IP, earliest time.Time, latest time.Time) (int, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM registrations WHERE initialIP = :ip AND :earliest < createdAt AND creat...
go
func (ssa *SQLStorageAuthority) CountRegistrationsByIP(ctx context.Context, ip net.IP, earliest time.Time, latest time.Time) (int, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM registrations WHERE initialIP = :ip AND :earliest < createdAt AND creat...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountRegistrationsByIP", "(", "ctx", "context", ".", "Context", ",", "ip", "net", ".", "IP", ",", "earliest", "time", ".", "Time", ",", "latest", "time", ".", "Time", ")", "(", "int", ",", "error", ...
// CountRegistrationsByIP returns the number of registrations created in the // time range for a single IP address.
[ "CountRegistrationsByIP", "returns", "the", "number", "of", "registrations", "created", "in", "the", "time", "range", "for", "a", "single", "IP", "address", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L320-L338
31,001
letsencrypt/boulder
sa/sa.go
CountCertificatesByNames
func (ssa *SQLStorageAuthority) CountCertificatesByNames(ctx context.Context, domains []string, earliest, latest time.Time) ([]*sapb.CountByNames_MapElement, error) { work := make(chan string, len(domains)) type result struct { err error count int domain string } results := make(chan result, len(domains))...
go
func (ssa *SQLStorageAuthority) CountCertificatesByNames(ctx context.Context, domains []string, earliest, latest time.Time) ([]*sapb.CountByNames_MapElement, error) { work := make(chan string, len(domains)) type result struct { err error count int domain string } results := make(chan result, len(domains))...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountCertificatesByNames", "(", "ctx", "context", ".", "Context", ",", "domains", "[", "]", "string", ",", "earliest", ",", "latest", "time", ".", "Time", ")", "(", "[", "]", "*", "sapb", ".", "CountB...
// CountCertificatesByNames counts, for each input domain, the number of // certificates issued in the given time range for that domain and its // subdomains. It returns a map from domains to counts, which is guaranteed to // contain an entry for each input domain, so long as err is nil. // Queries will be run in paral...
[ "CountCertificatesByNames", "counts", "for", "each", "input", "domain", "the", "number", "of", "certificates", "issued", "in", "the", "given", "time", "range", "for", "that", "domain", "and", "its", "subdomains", ".", "It", "returns", "a", "map", "from", "doma...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L373-L432
31,002
letsencrypt/boulder
sa/sa.go
countCertificatesByNameImpl
func (ssa *SQLStorageAuthority) countCertificatesByNameImpl( db dbSelector, domain string, earliest, latest time.Time, ) (int, error) { return ssa.countCertificates(db, domain, earliest, latest, countCertificatesSelect) }
go
func (ssa *SQLStorageAuthority) countCertificatesByNameImpl( db dbSelector, domain string, earliest, latest time.Time, ) (int, error) { return ssa.countCertificates(db, domain, earliest, latest, countCertificatesSelect) }
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "countCertificatesByNameImpl", "(", "db", "dbSelector", ",", "domain", "string", ",", "earliest", ",", "latest", "time", ".", "Time", ",", ")", "(", "int", ",", "error", ")", "{", "return", "ssa", ".", ...
// countCertificatesByNames returns, for a single domain, the count of // certificates issued in the given time range for that domain and its // subdomains.
[ "countCertificatesByNames", "returns", "for", "a", "single", "domain", "the", "count", "of", "certificates", "issued", "in", "the", "given", "time", "range", "for", "that", "domain", "and", "its", "subdomains", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L474-L481
31,003
letsencrypt/boulder
sa/sa.go
countCertificatesByExactNameImpl
func (ssa *SQLStorageAuthority) countCertificatesByExactNameImpl( db dbSelector, domain string, earliest, latest time.Time, ) (int, error) { return ssa.countCertificates(db, domain, earliest, latest, countCertificatesExactSelect) }
go
func (ssa *SQLStorageAuthority) countCertificatesByExactNameImpl( db dbSelector, domain string, earliest, latest time.Time, ) (int, error) { return ssa.countCertificates(db, domain, earliest, latest, countCertificatesExactSelect) }
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "countCertificatesByExactNameImpl", "(", "db", "dbSelector", ",", "domain", "string", ",", "earliest", ",", "latest", "time", ".", "Time", ",", ")", "(", "int", ",", "error", ")", "{", "return", "ssa", "...
// countCertificatesByExactNames returns, for a single domain, the count of // certificates issued in the given time range for that domain. In contrast to // countCertificatesByNames subdomains are NOT considered.
[ "countCertificatesByExactNames", "returns", "for", "a", "single", "domain", "the", "count", "of", "certificates", "issued", "in", "the", "given", "time", "range", "for", "that", "domain", ".", "In", "contrast", "to", "countCertificatesByNames", "subdomains", "are", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L486-L493
31,004
letsencrypt/boulder
sa/sa.go
countCertificates
func (ssa *SQLStorageAuthority) countCertificates(db dbSelector, domain string, earliest, latest time.Time, query string) (int, error) { var serials []string _, err := db.Select( &serials, query, map[string]interface{}{ "reversedDomain": ReverseName(domain), "earliest": earliest, "latest": ...
go
func (ssa *SQLStorageAuthority) countCertificates(db dbSelector, domain string, earliest, latest time.Time, query string) (int, error) { var serials []string _, err := db.Select( &serials, query, map[string]interface{}{ "reversedDomain": ReverseName(domain), "earliest": earliest, "latest": ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "countCertificates", "(", "db", "dbSelector", ",", "domain", "string", ",", "earliest", ",", "latest", "time", ".", "Time", ",", "query", "string", ")", "(", "int", ",", "error", ")", "{", "var", "seri...
// countCertificates returns, for a single domain, the count of certificate // issuances in the given time range for that domain using the // provided query assumed to be either `countCertificatesExactSelect`, // or `countCertificatesSelect`.
[ "countCertificates", "returns", "for", "a", "single", "domain", "the", "count", "of", "certificate", "issuances", "in", "the", "given", "time", "range", "for", "that", "domain", "using", "the", "provided", "query", "assumed", "to", "be", "either", "countCertific...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L499-L521
31,005
letsencrypt/boulder
sa/sa.go
GetCertificate
func (ssa *SQLStorageAuthority) GetCertificate(ctx context.Context, serial string) (core.Certificate, error) { if !core.ValidSerial(serial) { err := fmt.Errorf("Invalid certificate serial %s", serial) return core.Certificate{}, err } cert, err := SelectCertificate(ssa.dbMap.WithContext(ctx), "WHERE serial = ?",...
go
func (ssa *SQLStorageAuthority) GetCertificate(ctx context.Context, serial string) (core.Certificate, error) { if !core.ValidSerial(serial) { err := fmt.Errorf("Invalid certificate serial %s", serial) return core.Certificate{}, err } cert, err := SelectCertificate(ssa.dbMap.WithContext(ctx), "WHERE serial = ?",...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetCertificate", "(", "ctx", "context", ".", "Context", ",", "serial", "string", ")", "(", "core", ".", "Certificate", ",", "error", ")", "{", "if", "!", "core", ".", "ValidSerial", "(", "serial", ")"...
// GetCertificate takes a serial number and returns the corresponding // certificate, or error if it does not exist.
[ "GetCertificate", "takes", "a", "serial", "number", "and", "returns", "the", "corresponding", "certificate", "or", "error", "if", "it", "does", "not", "exist", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L525-L539
31,006
letsencrypt/boulder
sa/sa.go
GetCertificateStatus
func (ssa *SQLStorageAuthority) GetCertificateStatus(ctx context.Context, serial string) (core.CertificateStatus, error) { if !core.ValidSerial(serial) { err := fmt.Errorf("Invalid certificate serial %s", serial) return core.CertificateStatus{}, err } var status core.CertificateStatus statusObj, err := ssa.dbM...
go
func (ssa *SQLStorageAuthority) GetCertificateStatus(ctx context.Context, serial string) (core.CertificateStatus, error) { if !core.ValidSerial(serial) { err := fmt.Errorf("Invalid certificate serial %s", serial) return core.CertificateStatus{}, err } var status core.CertificateStatus statusObj, err := ssa.dbM...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetCertificateStatus", "(", "ctx", "context", ".", "Context", ",", "serial", "string", ")", "(", "core", ".", "CertificateStatus", ",", "error", ")", "{", "if", "!", "core", ".", "ValidSerial", "(", "se...
// GetCertificateStatus takes a hexadecimal string representing the full 128-bit serial // number of a certificate and returns data about that certificate's current // validity.
[ "GetCertificateStatus", "takes", "a", "hexadecimal", "string", "representing", "the", "full", "128", "-", "bit", "serial", "number", "of", "a", "certificate", "and", "returns", "data", "about", "that", "certificate", "s", "current", "validity", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L544-L572
31,007
letsencrypt/boulder
sa/sa.go
NewRegistration
func (ssa *SQLStorageAuthority) NewRegistration(ctx context.Context, reg core.Registration) (core.Registration, error) { reg.CreatedAt = ssa.clk.Now() rm, err := registrationToModel(&reg) if err != nil { return reg, err } err = ssa.dbMap.WithContext(ctx).Insert(rm) if err != nil { return reg, err } return m...
go
func (ssa *SQLStorageAuthority) NewRegistration(ctx context.Context, reg core.Registration) (core.Registration, error) { reg.CreatedAt = ssa.clk.Now() rm, err := registrationToModel(&reg) if err != nil { return reg, err } err = ssa.dbMap.WithContext(ctx).Insert(rm) if err != nil { return reg, err } return m...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "NewRegistration", "(", "ctx", "context", ".", "Context", ",", "reg", "core", ".", "Registration", ")", "(", "core", ".", "Registration", ",", "error", ")", "{", "reg", ".", "CreatedAt", "=", "ssa", "....
// NewRegistration stores a new Registration
[ "NewRegistration", "stores", "a", "new", "Registration" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L575-L586
31,008
letsencrypt/boulder
sa/sa.go
UpdateRegistration
func (ssa *SQLStorageAuthority) UpdateRegistration(ctx context.Context, reg core.Registration) error { const query = "WHERE id = ?" model, err := selectRegistration(ssa.dbMap.WithContext(ctx), query, reg.ID) if err == sql.ErrNoRows { return berrors.NotFoundError("registration with ID '%d' not found", reg.ID) } ...
go
func (ssa *SQLStorageAuthority) UpdateRegistration(ctx context.Context, reg core.Registration) error { const query = "WHERE id = ?" model, err := selectRegistration(ssa.dbMap.WithContext(ctx), query, reg.ID) if err == sql.ErrNoRows { return berrors.NotFoundError("registration with ID '%d' not found", reg.ID) } ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "UpdateRegistration", "(", "ctx", "context", ".", "Context", ",", "reg", "core", ".", "Registration", ")", "error", "{", "const", "query", "=", "\"", "\"", "\n", "model", ",", "err", ":=", "selectRegistr...
// UpdateRegistration stores an updated Registration
[ "UpdateRegistration", "stores", "an", "updated", "Registration" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L641-L665
31,009
letsencrypt/boulder
sa/sa.go
NewPendingAuthorization
func (ssa *SQLStorageAuthority) NewPendingAuthorization(ctx context.Context, authz core.Authorization) (core.Authorization, error) { var output core.Authorization tx, err := ssa.dbMap.Begin() if err != nil { return output, err } txWithCtx := tx.WithContext(ctx) // Create a random ID and check that it doesn't ...
go
func (ssa *SQLStorageAuthority) NewPendingAuthorization(ctx context.Context, authz core.Authorization) (core.Authorization, error) { var output core.Authorization tx, err := ssa.dbMap.Begin() if err != nil { return output, err } txWithCtx := tx.WithContext(ctx) // Create a random ID and check that it doesn't ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "NewPendingAuthorization", "(", "ctx", "context", ".", "Context", ",", "authz", "core", ".", "Authorization", ")", "(", "core", ".", "Authorization", ",", "error", ")", "{", "var", "output", "core", ".", ...
// NewPendingAuthorization retrieves a pending authorization for // authz.Identifier if one exists, or creates a new one otherwise.
[ "NewPendingAuthorization", "retrieves", "a", "pending", "authorization", "for", "authz", ".", "Identifier", "if", "one", "exists", "or", "creates", "a", "new", "one", "otherwise", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L669-L721
31,010
letsencrypt/boulder
sa/sa.go
GetPendingAuthorization
func (ssa *SQLStorageAuthority) GetPendingAuthorization( ctx context.Context, req *sapb.GetPendingAuthorizationRequest, ) (*core.Authorization, error) { identifierJSON, err := json.Marshal(core.AcmeIdentifier{ Type: core.IdentifierType(*req.IdentifierType), Value: *req.IdentifierValue, }) if err != nil { re...
go
func (ssa *SQLStorageAuthority) GetPendingAuthorization( ctx context.Context, req *sapb.GetPendingAuthorizationRequest, ) (*core.Authorization, error) { identifierJSON, err := json.Marshal(core.AcmeIdentifier{ Type: core.IdentifierType(*req.IdentifierType), Value: *req.IdentifierValue, }) if err != nil { re...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetPendingAuthorization", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetPendingAuthorizationRequest", ",", ")", "(", "*", "core", ".", "Authorization", ",", "error", ")", "{", "...
// GetPendingAuthorization returns the most recent Pending authorization // with the given identifier, if available.
[ "GetPendingAuthorization", "returns", "the", "most", "recent", "Pending", "authorization", "with", "the", "given", "identifier", "if", "available", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L725-L766
31,011
letsencrypt/boulder
sa/sa.go
FinalizeAuthorization
func (ssa *SQLStorageAuthority) FinalizeAuthorization(ctx context.Context, authz core.Authorization) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) // Check that a pending authz exists if !existingPending(txWithCtx, authz.ID) { err = berrors.NotFoundError("...
go
func (ssa *SQLStorageAuthority) FinalizeAuthorization(ctx context.Context, authz core.Authorization) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) // Check that a pending authz exists if !existingPending(txWithCtx, authz.ID) { err = berrors.NotFoundError("...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "FinalizeAuthorization", "(", "ctx", "context", ".", "Context", ",", "authz", "core", ".", "Authorization", ")", "error", "{", "tx", ",", "err", ":=", "ssa", ".", "dbMap", ".", "Begin", "(", ")", "\n",...
// FinalizeAuthorization converts a Pending Authorization to a final one. If the // Authorization is not found a berrors.NotFound result is returned. If the // Authorization is status pending a berrors.InternalServer error is returned.
[ "FinalizeAuthorization", "converts", "a", "Pending", "Authorization", "to", "a", "final", "one", ".", "If", "the", "Authorization", "is", "not", "found", "a", "berrors", ".", "NotFound", "result", "is", "returned", ".", "If", "the", "Authorization", "is", "sta...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L771-L813
31,012
letsencrypt/boulder
sa/sa.go
RevokeAuthorizationsByDomain
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain(ctx context.Context, ident core.AcmeIdentifier) (int64, int64, error) { identifierJSON, err := json.Marshal(ident) if err != nil { return 0, 0, err } identifier := string(identifierJSON) results := []int64{0, 0} now := ssa.clk.Now() for i, table := ...
go
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain(ctx context.Context, ident core.AcmeIdentifier) (int64, int64, error) { identifierJSON, err := json.Marshal(ident) if err != nil { return 0, 0, err } identifier := string(identifierJSON) results := []int64{0, 0} now := ssa.clk.Now() for i, table := ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "RevokeAuthorizationsByDomain", "(", "ctx", "context", ".", "Context", ",", "ident", "core", ".", "AcmeIdentifier", ")", "(", "int64", ",", "int64", ",", "error", ")", "{", "identifierJSON", ",", "err", ":...
// RevokeAuthorizationsByDomain invalidates all pending or finalized authorizations // for a specific domain
[ "RevokeAuthorizationsByDomain", "invalidates", "all", "pending", "or", "finalized", "authorizations", "for", "a", "specific", "domain" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L817-L849
31,013
letsencrypt/boulder
sa/sa.go
RevokeAuthorizationsByDomain2
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain2(ctx context.Context, req *sapb.RevokeAuthorizationsByDomainRequest) (*corepb.Empty, error) { finalRevoked, pendingRevoked, err := ssa.RevokeAuthorizationsByDomain( ctx, core.AcmeIdentifier{ Type: core.IdentifierDNS, Value: *req.Domain, }) if e...
go
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain2(ctx context.Context, req *sapb.RevokeAuthorizationsByDomainRequest) (*corepb.Empty, error) { finalRevoked, pendingRevoked, err := ssa.RevokeAuthorizationsByDomain( ctx, core.AcmeIdentifier{ Type: core.IdentifierDNS, Value: *req.Domain, }) if e...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "RevokeAuthorizationsByDomain2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "RevokeAuthorizationsByDomainRequest", ")", "(", "*", "corepb", ".", "Empty", ",", "error", ")", "{", "fi...
// RevokeAuthorizationsByDomain2 invalidates all pending or valid authorizations for a // specific domain. This method is intended to deprecate RevokeAuthorizationsByDomain.
[ "RevokeAuthorizationsByDomain2", "invalidates", "all", "pending", "or", "valid", "authorizations", "for", "a", "specific", "domain", ".", "This", "method", "is", "intended", "to", "deprecate", "RevokeAuthorizationsByDomain", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L886-L923
31,014
letsencrypt/boulder
sa/sa.go
AddCertificate
func (ssa *SQLStorageAuthority) AddCertificate( ctx context.Context, certDER []byte, regID int64, ocspResponse []byte, issued *time.Time) (string, error) { parsedCertificate, err := x509.ParseCertificate(certDER) if err != nil { return "", err } digest := core.Fingerprint256(certDER) serial := core.SerialTo...
go
func (ssa *SQLStorageAuthority) AddCertificate( ctx context.Context, certDER []byte, regID int64, ocspResponse []byte, issued *time.Time) (string, error) { parsedCertificate, err := x509.ParseCertificate(certDER) if err != nil { return "", err } digest := core.Fingerprint256(certDER) serial := core.SerialTo...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "AddCertificate", "(", "ctx", "context", ".", "Context", ",", "certDER", "[", "]", "byte", ",", "regID", "int64", ",", "ocspResponse", "[", "]", "byte", ",", "issued", "*", "time", ".", "Time", ")", ...
// AddCertificate stores an issued certificate and returns the digest as // a string, or an error if any occurred.
[ "AddCertificate", "stores", "an", "issued", "certificate", "and", "returns", "the", "digest", "as", "a", "string", "or", "an", "error", "if", "any", "occurred", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L927-L1028
31,015
letsencrypt/boulder
sa/sa.go
CountPendingAuthorizations
func (ssa *SQLStorageAuthority) CountPendingAuthorizations(ctx context.Context, regID int64) (count int, err error) { err = ssa.dbMap.WithContext(ctx).SelectOne(&count, `SELECT count(1) FROM pendingAuthorizations WHERE registrationID = :regID AND expires > :now AND status = :pending`, map[string]interface{}{...
go
func (ssa *SQLStorageAuthority) CountPendingAuthorizations(ctx context.Context, regID int64) (count int, err error) { err = ssa.dbMap.WithContext(ctx).SelectOne(&count, `SELECT count(1) FROM pendingAuthorizations WHERE registrationID = :regID AND expires > :now AND status = :pending`, map[string]interface{}{...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountPendingAuthorizations", "(", "ctx", "context", ".", "Context", ",", "regID", "int64", ")", "(", "count", "int", ",", "err", "error", ")", "{", "err", "=", "ssa", ".", "dbMap", ".", "WithContext", ...
// CountPendingAuthorizations returns the number of pending, unexpired // authorizations for the given registration.
[ "CountPendingAuthorizations", "returns", "the", "number", "of", "pending", "unexpired", "authorizations", "for", "the", "given", "registration", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1032-L1044
31,016
letsencrypt/boulder
sa/sa.go
CountInvalidAuthorizations
func (ssa *SQLStorageAuthority) CountInvalidAuthorizations( ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest, ) (count *sapb.Count, err error) { identifier := core.AcmeIdentifier{ Type: core.IdentifierDNS, Value: *req.Hostname, } idJSON, err := json.Marshal(identifier) if err != nil { retu...
go
func (ssa *SQLStorageAuthority) CountInvalidAuthorizations( ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest, ) (count *sapb.Count, err error) { identifier := core.AcmeIdentifier{ Type: core.IdentifierDNS, Value: *req.Hostname, } idJSON, err := json.Marshal(identifier) if err != nil { retu...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountInvalidAuthorizations", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "CountInvalidAuthorizationsRequest", ",", ")", "(", "count", "*", "sapb", ".", "Count", ",", "err", "error",...
// CountInvalidAuthorizations counts invalid authorizations for a user expiring // in a given time range. // authorizations for the give registration.
[ "CountInvalidAuthorizations", "counts", "invalid", "authorizations", "for", "a", "user", "expiring", "in", "a", "given", "time", "range", ".", "authorizations", "for", "the", "give", "registration", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1067-L1099
31,017
letsencrypt/boulder
sa/sa.go
addOrderFQDNSet
func addOrderFQDNSet( db dbInserter, names []string, orderID int64, regID int64, expires time.Time) error { return db.Insert(&orderFQDNSet{ SetHash: hashNames(names), OrderID: orderID, RegistrationID: regID, Expires: expires, }) }
go
func addOrderFQDNSet( db dbInserter, names []string, orderID int64, regID int64, expires time.Time) error { return db.Insert(&orderFQDNSet{ SetHash: hashNames(names), OrderID: orderID, RegistrationID: regID, Expires: expires, }) }
[ "func", "addOrderFQDNSet", "(", "db", "dbInserter", ",", "names", "[", "]", "string", ",", "orderID", "int64", ",", "regID", "int64", ",", "expires", "time", ".", "Time", ")", "error", "{", "return", "db", ".", "Insert", "(", "&", "orderFQDNSet", "{", ...
// addOrderFQDNSet creates a new OrderFQDNSet row using the provided // information. This function accepts a transaction so that the orderFqdnSet // addition can take place within the order addition transaction. The caller is // required to rollback the transaction if an error is returned.
[ "addOrderFQDNSet", "creates", "a", "new", "OrderFQDNSet", "row", "using", "the", "provided", "information", ".", "This", "function", "accepts", "a", "transaction", "so", "that", "the", "orderFqdnSet", "addition", "can", "take", "place", "within", "the", "order", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1120-L1132
31,018
letsencrypt/boulder
sa/sa.go
deleteOrderFQDNSet
func deleteOrderFQDNSet( db dbExecer, orderID int64) error { result, err := db.Exec(` DELETE FROM orderFqdnSets WHERE orderID = ?`, orderID) if err != nil { return err } rowsDeleted, err := result.RowsAffected() if err != nil { return err } // We always expect there to be an order FQDN set row for ...
go
func deleteOrderFQDNSet( db dbExecer, orderID int64) error { result, err := db.Exec(` DELETE FROM orderFqdnSets WHERE orderID = ?`, orderID) if err != nil { return err } rowsDeleted, err := result.RowsAffected() if err != nil { return err } // We always expect there to be an order FQDN set row for ...
[ "func", "deleteOrderFQDNSet", "(", "db", "dbExecer", ",", "orderID", "int64", ")", "error", "{", "result", ",", "err", ":=", "db", ".", "Exec", "(", "`\n\t DELETE FROM orderFqdnSets\n\t\tWHERE orderID = ?`", ",", "orderID", ")", "\n", "if", "err", "!=", "nil", ...
// deleteOrderFQDNSet deletes a OrderFQDNSet row that matches the provided // orderID. This function accepts a transaction so that the deletion can // take place within the finalization transaction. The caller is required to // rollback the transaction if an error is returned.
[ "deleteOrderFQDNSet", "deletes", "a", "OrderFQDNSet", "row", "that", "matches", "the", "provided", "orderID", ".", "This", "function", "accepts", "a", "transaction", "so", "that", "the", "deletion", "can", "take", "place", "within", "the", "finalization", "transac...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1138-L1160
31,019
letsencrypt/boulder
sa/sa.go
CountFQDNSets
func (ssa *SQLStorageAuthority) CountFQDNSets(ctx context.Context, window time.Duration, names []string) (int64, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM fqdnSets WHERE setHash = ? AND issued > ?`, hashNames(names), ssa.clk.Now().Add(-window), ) ...
go
func (ssa *SQLStorageAuthority) CountFQDNSets(ctx context.Context, window time.Duration, names []string) (int64, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM fqdnSets WHERE setHash = ? AND issued > ?`, hashNames(names), ssa.clk.Now().Add(-window), ) ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountFQDNSets", "(", "ctx", "context", ".", "Context", ",", "window", "time", ".", "Duration", ",", "names", "[", "]", "string", ")", "(", "int64", ",", "error", ")", "{", "var", "count", "int64", "...
// CountFQDNSets returns the number of sets with hash |setHash| within the window // |window|
[ "CountFQDNSets", "returns", "the", "number", "of", "sets", "with", "hash", "|setHash|", "within", "the", "window", "|window|" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1180-L1191
31,020
letsencrypt/boulder
sa/sa.go
getFQDNSetsBySerials
func (ssa *SQLStorageAuthority) getFQDNSetsBySerials( db dbSelector, serials []string, ) ([]setHash, error) { var fqdnSets []setHash // It is unexpected that this function would be called with no serials if len(serials) == 0 { err := fmt.Errorf("getFQDNSetsBySerials called with no serials") ssa.log.AuditErr(e...
go
func (ssa *SQLStorageAuthority) getFQDNSetsBySerials( db dbSelector, serials []string, ) ([]setHash, error) { var fqdnSets []setHash // It is unexpected that this function would be called with no serials if len(serials) == 0 { err := fmt.Errorf("getFQDNSetsBySerials called with no serials") ssa.log.AuditErr(e...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "getFQDNSetsBySerials", "(", "db", "dbSelector", ",", "serials", "[", "]", "string", ",", ")", "(", "[", "]", "setHash", ",", "error", ")", "{", "var", "fqdnSets", "[", "]", "setHash", "\n\n", "// It i...
// getFQDNSetsBySerials finds the setHashes corresponding to a set of // certificate serials. These serials can be used to check whether any // certificates have been issued for the same set of names previously.
[ "getFQDNSetsBySerials", "finds", "the", "setHashes", "corresponding", "to", "a", "set", "of", "certificate", "serials", ".", "These", "serials", "can", "be", "used", "to", "check", "whether", "any", "certificates", "have", "been", "issued", "for", "the", "same",...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1199-L1238
31,021
letsencrypt/boulder
sa/sa.go
FQDNSetExists
func (ssa *SQLStorageAuthority) FQDNSetExists(ctx context.Context, names []string) (bool, error) { exists, err := ssa.checkFQDNSetExists( ssa.dbMap.WithContext(ctx).SelectOne, names) if err != nil { return false, err } return exists, nil }
go
func (ssa *SQLStorageAuthority) FQDNSetExists(ctx context.Context, names []string) (bool, error) { exists, err := ssa.checkFQDNSetExists( ssa.dbMap.WithContext(ctx).SelectOne, names) if err != nil { return false, err } return exists, nil }
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "FQDNSetExists", "(", "ctx", "context", ".", "Context", ",", "names", "[", "]", "string", ")", "(", "bool", ",", "error", ")", "{", "exists", ",", "err", ":=", "ssa", ".", "checkFQDNSetExists", "(", ...
// FQDNSetExists returns a bool indicating if one or more FQDN sets |names| // exists in the database
[ "FQDNSetExists", "returns", "a", "bool", "indicating", "if", "one", "or", "more", "FQDN", "sets", "|names|", "exists", "in", "the", "database" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1312-L1320
31,022
letsencrypt/boulder
sa/sa.go
checkFQDNSetExists
func (ssa *SQLStorageAuthority) checkFQDNSetExists(selector oneSelectorFunc, names []string) (bool, error) { var count int64 err := selector( &count, `SELECT COUNT(1) FROM fqdnSets WHERE setHash = ? LIMIT 1`, hashNames(names), ) return count > 0, err }
go
func (ssa *SQLStorageAuthority) checkFQDNSetExists(selector oneSelectorFunc, names []string) (bool, error) { var count int64 err := selector( &count, `SELECT COUNT(1) FROM fqdnSets WHERE setHash = ? LIMIT 1`, hashNames(names), ) return count > 0, err }
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "checkFQDNSetExists", "(", "selector", "oneSelectorFunc", ",", "names", "[", "]", "string", ")", "(", "bool", ",", "error", ")", "{", "var", "count", "int64", "\n", "err", ":=", "selector", "(", "&", "...
// checkFQDNSetExists uses the given oneSelectorFunc to check whether an fqdnSet // for the given names exists.
[ "checkFQDNSetExists", "uses", "the", "given", "oneSelectorFunc", "to", "check", "whether", "an", "fqdnSet", "for", "the", "given", "names", "exists", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1328-L1338
31,023
letsencrypt/boulder
sa/sa.go
DeactivateRegistration
func (ssa *SQLStorageAuthority) DeactivateRegistration(ctx context.Context, id int64) error { _, err := ssa.dbMap.WithContext(ctx).Exec( "UPDATE registrations SET status = ? WHERE status = ? AND id = ?", string(core.StatusDeactivated), string(core.StatusValid), id, ) return err }
go
func (ssa *SQLStorageAuthority) DeactivateRegistration(ctx context.Context, id int64) error { _, err := ssa.dbMap.WithContext(ctx).Exec( "UPDATE registrations SET status = ? WHERE status = ? AND id = ?", string(core.StatusDeactivated), string(core.StatusValid), id, ) return err }
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "DeactivateRegistration", "(", "ctx", "context", ".", "Context", ",", "id", "int64", ")", "error", "{", "_", ",", "err", ":=", "ssa", ".", "dbMap", ".", "WithContext", "(", "ctx", ")", ".", "Exec", "...
// DeactivateRegistration deactivates a currently valid registration
[ "DeactivateRegistration", "deactivates", "a", "currently", "valid", "registration" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1399-L1407
31,024
letsencrypt/boulder
sa/sa.go
DeactivateAuthorization
func (ssa *SQLStorageAuthority) DeactivateAuthorization(ctx context.Context, id string) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) if existingPending(txWithCtx, id) { authzObj, err := txWithCtx.Get(&pendingauthzModel{}, id) if err != nil { return Ro...
go
func (ssa *SQLStorageAuthority) DeactivateAuthorization(ctx context.Context, id string) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) if existingPending(txWithCtx, id) { authzObj, err := txWithCtx.Get(&pendingauthzModel{}, id) if err != nil { return Ro...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "DeactivateAuthorization", "(", "ctx", "context", ".", "Context", ",", "id", "string", ")", "error", "{", "tx", ",", "err", ":=", "ssa", ".", "dbMap", ".", "Begin", "(", ")", "\n", "if", "err", "!=",...
// DeactivateAuthorization deactivates a currently valid or pending authorization
[ "DeactivateAuthorization", "deactivates", "a", "currently", "valid", "or", "pending", "authorization" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1410-L1455
31,025
letsencrypt/boulder
sa/sa.go
DeactivateAuthorization2
func (ssa *SQLStorageAuthority) DeactivateAuthorization2(ctx context.Context, req *sapb.AuthorizationID2) (*corepb.Empty, error) { _, err := ssa.dbMap.Exec( `UPDATE authz2 SET status = :deactivated WHERE id = :id and status IN (:valid,:pending)`, map[string]interface{}{ "deactivated": statusUint(core.StatusDeac...
go
func (ssa *SQLStorageAuthority) DeactivateAuthorization2(ctx context.Context, req *sapb.AuthorizationID2) (*corepb.Empty, error) { _, err := ssa.dbMap.Exec( `UPDATE authz2 SET status = :deactivated WHERE id = :id and status IN (:valid,:pending)`, map[string]interface{}{ "deactivated": statusUint(core.StatusDeac...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "DeactivateAuthorization2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "AuthorizationID2", ")", "(", "*", "corepb", ".", "Empty", ",", "error", ")", "{", "_", ",", "err", ":="...
// DeactivateAuthorization2 deactivates a currently valid or pending authorization. // This method is intended to deprecate DeactivateAuthorization.
[ "DeactivateAuthorization2", "deactivates", "a", "currently", "valid", "or", "pending", "authorization", ".", "This", "method", "is", "intended", "to", "deprecate", "DeactivateAuthorization", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1459-L1473
31,026
letsencrypt/boulder
sa/sa.go
NewOrder
func (ssa *SQLStorageAuthority) NewOrder(ctx context.Context, req *corepb.Order) (*corepb.Order, error) { order := &orderModel{ RegistrationID: *req.RegistrationID, Expires: time.Unix(0, *req.Expires), Created: ssa.clk.Now(), } tx, err := ssa.dbMap.Begin() if err != nil { return nil, err } ...
go
func (ssa *SQLStorageAuthority) NewOrder(ctx context.Context, req *corepb.Order) (*corepb.Order, error) { order := &orderModel{ RegistrationID: *req.RegistrationID, Expires: time.Unix(0, *req.Expires), Created: ssa.clk.Now(), } tx, err := ssa.dbMap.Begin() if err != nil { return nil, err } ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "NewOrder", "(", "ctx", "context", ".", "Context", ",", "req", "*", "corepb", ".", "Order", ")", "(", "*", "corepb", ".", "Order", ",", "error", ")", "{", "order", ":=", "&", "orderModel", "{", "Re...
// NewOrder adds a new v2 style order to the database
[ "NewOrder", "adds", "a", "new", "v2", "style", "order", "to", "the", "database" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1476-L1549
31,027
letsencrypt/boulder
sa/sa.go
SetOrderError
func (ssa *SQLStorageAuthority) SetOrderError(ctx context.Context, order *corepb.Order) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) om, err := orderToModel(order) if err != nil { return Rollback(tx, err) } result, err := txWithCtx.Exec(` UPDATE orde...
go
func (ssa *SQLStorageAuthority) SetOrderError(ctx context.Context, order *corepb.Order) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) om, err := orderToModel(order) if err != nil { return Rollback(tx, err) } result, err := txWithCtx.Exec(` UPDATE orde...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "SetOrderError", "(", "ctx", "context", ".", "Context", ",", "order", "*", "corepb", ".", "Order", ")", "error", "{", "tx", ",", "err", ":=", "ssa", ".", "dbMap", ".", "Begin", "(", ")", "\n", "if"...
// SetOrderError updates a provided Order's error field.
[ "SetOrderError", "updates", "a", "provided", "Order", "s", "error", "field", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1584-L1614
31,028
letsencrypt/boulder
sa/sa.go
GetOrder
func (ssa *SQLStorageAuthority) GetOrder(ctx context.Context, req *sapb.OrderRequest) (*corepb.Order, error) { omObj, err := ssa.dbMap.WithContext(ctx).Get(orderModel{}, *req.Id) if err == sql.ErrNoRows || omObj == nil { return nil, berrors.NotFoundError("no order found for ID %d", *req.Id) } if err != nil { re...
go
func (ssa *SQLStorageAuthority) GetOrder(ctx context.Context, req *sapb.OrderRequest) (*corepb.Order, error) { omObj, err := ssa.dbMap.WithContext(ctx).Get(orderModel{}, *req.Id) if err == sql.ErrNoRows || omObj == nil { return nil, berrors.NotFoundError("no order found for ID %d", *req.Id) } if err != nil { re...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetOrder", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "OrderRequest", ")", "(", "*", "corepb", ".", "Order", ",", "error", ")", "{", "omObj", ",", "err", ":=", "ssa", "."...
// GetOrder is used to retrieve an already existing order object
[ "GetOrder", "is", "used", "to", "retrieve", "an", "already", "existing", "order", "object" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1695-L1738
31,029
letsencrypt/boulder
sa/sa.go
GetValidOrderAuthorizations
func (ssa *SQLStorageAuthority) GetValidOrderAuthorizations( ctx context.Context, req *sapb.GetValidOrderAuthorizationsRequest) (map[string]*core.Authorization, error) { now := ssa.clk.Now() // Select the full authorization data for all *valid, unexpired* // authorizations that are owned by the correct account ID ...
go
func (ssa *SQLStorageAuthority) GetValidOrderAuthorizations( ctx context.Context, req *sapb.GetValidOrderAuthorizationsRequest) (map[string]*core.Authorization, error) { now := ssa.clk.Now() // Select the full authorization data for all *valid, unexpired* // authorizations that are owned by the correct account ID ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetValidOrderAuthorizations", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetValidOrderAuthorizationsRequest", ")", "(", "map", "[", "string", "]", "*", "core", ".", "Authorization",...
// GetValidOrderAuthorizations is used to find the valid, unexpired authorizations // associated with a specific order and account ID.
[ "GetValidOrderAuthorizations", "is", "used", "to", "find", "the", "valid", "unexpired", "authorizations", "associated", "with", "a", "specific", "order", "and", "account", "ID", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L1948-L1993
31,030
letsencrypt/boulder
sa/sa.go
GetAuthorizations
func (ssa *SQLStorageAuthority) GetAuthorizations( ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error) { authzMap, err := ssa.getAuthorizations( ctx, authorizationTable, string(core.StatusValid), *req.RegistrationID, req.Domains, time.Unix(0, *req.Now), *req.RequireV2...
go
func (ssa *SQLStorageAuthority) GetAuthorizations( ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error) { authzMap, err := ssa.getAuthorizations( ctx, authorizationTable, string(core.StatusValid), *req.RegistrationID, req.Domains, time.Unix(0, *req.Now), *req.RequireV2...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetAuthorizations", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetAuthorizationsRequest", ")", "(", "*", "sapb", ".", "Authorizations", ",", "error", ")", "{", "authzMap", ",", ...
// GetAuthorizations returns a map of valid or pending authorizations for as many names as possible
[ "GetAuthorizations", "returns", "a", "map", "of", "valid", "or", "pending", "authorizations", "for", "as", "many", "names", "as", "possible" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2143-L2195
31,031
letsencrypt/boulder
sa/sa.go
AddPendingAuthorizations
func (ssa *SQLStorageAuthority) AddPendingAuthorizations(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.AuthorizationIDs, error) { ids := []string{} for _, authPB := range req.Authz { authz, err := bgrpc.PBToAuthz(authPB) if err != nil { return nil, err } result, err := ssa.NewPendi...
go
func (ssa *SQLStorageAuthority) AddPendingAuthorizations(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.AuthorizationIDs, error) { ids := []string{} for _, authPB := range req.Authz { authz, err := bgrpc.PBToAuthz(authPB) if err != nil { return nil, err } result, err := ssa.NewPendi...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "AddPendingAuthorizations", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "AddPendingAuthorizationsRequest", ")", "(", "*", "sapb", ".", "AuthorizationIDs", ",", "error", ")", "{", "id...
// AddPendingAuthorizations creates a batch of pending authorizations and returns their IDs
[ "AddPendingAuthorizations", "creates", "a", "batch", "of", "pending", "authorizations", "and", "returns", "their", "IDs" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2198-L2212
31,032
letsencrypt/boulder
sa/sa.go
NewAuthorizations2
func (ssa *SQLStorageAuthority) NewAuthorizations2(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.Authorization2IDs, error) { ids := &sapb.Authorization2IDs{} for _, authz := range req.Authz { if *authz.Status != string(core.StatusPending) { return nil, berrors.InternalServerError("author...
go
func (ssa *SQLStorageAuthority) NewAuthorizations2(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.Authorization2IDs, error) { ids := &sapb.Authorization2IDs{} for _, authz := range req.Authz { if *authz.Status != string(core.StatusPending) { return nil, berrors.InternalServerError("author...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "NewAuthorizations2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "AddPendingAuthorizationsRequest", ")", "(", "*", "sapb", ".", "Authorization2IDs", ",", "error", ")", "{", "ids", ...
// NewAuthorizations2 adds a set of new style authorizations to the database and returns // either the IDs of the authorizations or an error. It will only process corepb.Authorization // objects if the V2 field is set. This method is intended to deprecate AddPendingAuthorizations
[ "NewAuthorizations2", "adds", "a", "set", "of", "new", "style", "authorizations", "to", "the", "database", "and", "returns", "either", "the", "IDs", "of", "the", "authorizations", "or", "an", "error", ".", "It", "will", "only", "process", "corepb", ".", "Aut...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2238-L2255
31,033
letsencrypt/boulder
sa/sa.go
GetAuthorization2
func (ssa *SQLStorageAuthority) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error) { obj, err := ssa.dbMap.Get(authz2Model{}, *id.Id) if err != nil { return nil, err } if obj == nil { return nil, berrors.NotFoundError("authorization %d not found", *id.Id) } return...
go
func (ssa *SQLStorageAuthority) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error) { obj, err := ssa.dbMap.Get(authz2Model{}, *id.Id) if err != nil { return nil, err } if obj == nil { return nil, berrors.NotFoundError("authorization %d not found", *id.Id) } return...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetAuthorization2", "(", "ctx", "context", ".", "Context", ",", "id", "*", "sapb", ".", "AuthorizationID2", ")", "(", "*", "corepb", ".", "Authorization", ",", "error", ")", "{", "obj", ",", "err", ":...
// GetAuthorization2 returns the authz2 style authorization identified by the provided ID or an error. // If no authorization is found matching the ID a berrors.NotFound type error is returned. This method // is intended to deprecate GetAuthorization.
[ "GetAuthorization2", "returns", "the", "authz2", "style", "authorization", "identified", "by", "the", "provided", "ID", "or", "an", "error", ".", "If", "no", "authorization", "is", "found", "matching", "the", "ID", "a", "berrors", ".", "NotFound", "type", "err...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2260-L2269
31,034
letsencrypt/boulder
sa/sa.go
authz2ModelMapToPB
func authz2ModelMapToPB(m map[string]authz2Model) (*sapb.Authorizations, error) { resp := &sapb.Authorizations{} for k, v := range m { // Make a copy of k because it will be reassigned with each loop. kCopy := k authzPB, err := modelToAuthzPB(&v) if err != nil { return nil, err } resp.Authz = append(re...
go
func authz2ModelMapToPB(m map[string]authz2Model) (*sapb.Authorizations, error) { resp := &sapb.Authorizations{} for k, v := range m { // Make a copy of k because it will be reassigned with each loop. kCopy := k authzPB, err := modelToAuthzPB(&v) if err != nil { return nil, err } resp.Authz = append(re...
[ "func", "authz2ModelMapToPB", "(", "m", "map", "[", "string", "]", "authz2Model", ")", "(", "*", "sapb", ".", "Authorizations", ",", "error", ")", "{", "resp", ":=", "&", "sapb", ".", "Authorizations", "{", "}", "\n", "for", "k", ",", "v", ":=", "ran...
// authz2ModelMapToPB converts a mapping of domain name to authz2Models into a // protobuf authorizations map
[ "authz2ModelMapToPB", "converts", "a", "mapping", "of", "domain", "name", "to", "authz2Models", "into", "a", "protobuf", "authorizations", "map" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2273-L2285
31,035
letsencrypt/boulder
sa/sa.go
FinalizeAuthorization2
func (ssa *SQLStorageAuthority) FinalizeAuthorization2(ctx context.Context, req *sapb.FinalizeAuthorizationRequest) error { if *req.Status != string(core.StatusValid) && *req.Status != string(core.StatusInvalid) { return berrors.InternalServerError("authorization must have status valid or invalid") } query := `UPD...
go
func (ssa *SQLStorageAuthority) FinalizeAuthorization2(ctx context.Context, req *sapb.FinalizeAuthorizationRequest) error { if *req.Status != string(core.StatusValid) && *req.Status != string(core.StatusInvalid) { return berrors.InternalServerError("authorization must have status valid or invalid") } query := `UPD...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "FinalizeAuthorization2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "FinalizeAuthorizationRequest", ")", "error", "{", "if", "*", "req", ".", "Status", "!=", "string", "(", "core...
// FinalizeAuthorization2 moves a pending authorization to either the valid or invalid status. If // the authorization is being moved to invalid the validationError field must be set. If the // authorization is being moved to valid the validationRecord and expires fields must be set. // This method is intended to depre...
[ "FinalizeAuthorization2", "moves", "a", "pending", "authorization", "to", "either", "the", "valid", "or", "invalid", "status", ".", "If", "the", "authorization", "is", "being", "moved", "to", "invalid", "the", "validationError", "field", "must", "be", "set", "."...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2371-L2432
31,036
letsencrypt/boulder
sa/sa.go
RevokeCertificate
func (ssa *SQLStorageAuthority) RevokeCertificate(ctx context.Context, req *sapb.RevokeCertificateRequest) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) status, err := SelectCertificateStatus( txWithCtx, "WHERE serial = ? AND status != ?", *req.Serial, ...
go
func (ssa *SQLStorageAuthority) RevokeCertificate(ctx context.Context, req *sapb.RevokeCertificateRequest) error { tx, err := ssa.dbMap.Begin() if err != nil { return err } txWithCtx := tx.WithContext(ctx) status, err := SelectCertificateStatus( txWithCtx, "WHERE serial = ? AND status != ?", *req.Serial, ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "RevokeCertificate", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "RevokeCertificateRequest", ")", "error", "{", "tx", ",", "err", ":=", "ssa", ".", "dbMap", ".", "Begin", "(", ...
// RevokeCertificate stores revocation information about a certificate. It will only store this // information if the certificate is not alreay marked as revoked. This method is meant as a // replacement for MarkCertificateRevoked and the ocsp-updater database methods.
[ "RevokeCertificate", "stores", "revocation", "information", "about", "a", "certificate", ".", "It", "will", "only", "store", "this", "information", "if", "the", "certificate", "is", "not", "alreay", "marked", "as", "revoked", ".", "This", "method", "is", "meant"...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2437-L2475
31,037
letsencrypt/boulder
sa/sa.go
GetPendingAuthorization2
func (ssa *SQLStorageAuthority) GetPendingAuthorization2(ctx context.Context, req *sapb.GetPendingAuthorizationRequest) (*corepb.Authorization, error) { var am authz2Model err := ssa.dbMap.WithContext(ctx).SelectOne( &am, fmt.Sprintf(`SELECT %s FROM authz2 WHERE registrationID = :regID AND identifierValue =...
go
func (ssa *SQLStorageAuthority) GetPendingAuthorization2(ctx context.Context, req *sapb.GetPendingAuthorizationRequest) (*corepb.Authorization, error) { var am authz2Model err := ssa.dbMap.WithContext(ctx).SelectOne( &am, fmt.Sprintf(`SELECT %s FROM authz2 WHERE registrationID = :regID AND identifierValue =...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetPendingAuthorization2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetPendingAuthorizationRequest", ")", "(", "*", "corepb", ".", "Authorization", ",", "error", ")", "{", "var"...
// GetPendingAuthorization2 returns the most recent Pending authorization with // the given identifier, if available. This method is intended to deprecate // GetPendingAuthorization.
[ "GetPendingAuthorization2", "returns", "the", "most", "recent", "Pending", "authorization", "with", "the", "given", "identifier", "if", "available", ".", "This", "method", "is", "intended", "to", "deprecate", "GetPendingAuthorization", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2480-L2510
31,038
letsencrypt/boulder
sa/sa.go
CountPendingAuthorizations2
func (ssa *SQLStorageAuthority) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID) (*sapb.Count, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne(&count, `SELECT COUNT(1) FROM authz2 WHERE registrationID = :regID AND expires > :expires AND status = :status`, map[s...
go
func (ssa *SQLStorageAuthority) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID) (*sapb.Count, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne(&count, `SELECT COUNT(1) FROM authz2 WHERE registrationID = :regID AND expires > :expires AND status = :status`, map[s...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountPendingAuthorizations2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "RegistrationID", ")", "(", "*", "sapb", ".", "Count", ",", "error", ")", "{", "var", "count", "int64",...
// CountPendingAuthorizations2 returns the number of pending, unexpired authorizations // for the given registration. This method is intended to deprecate CountPendingAuthorizations.
[ "CountPendingAuthorizations2", "returns", "the", "number", "of", "pending", "unexpired", "authorizations", "for", "the", "given", "registration", ".", "This", "method", "is", "intended", "to", "deprecate", "CountPendingAuthorizations", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2514-L2538
31,039
letsencrypt/boulder
sa/sa.go
GetValidOrderAuthorizations2
func (ssa *SQLStorageAuthority) GetValidOrderAuthorizations2(ctx context.Context, req *sapb.GetValidOrderAuthorizationsRequest) (*sapb.Authorizations, error) { var ams []authz2Model _, err := ssa.dbMap.WithContext(ctx).Select( &ams, fmt.Sprintf(`SELECT %s FROM authz2 LEFT JOIN orderToAuthz2 ON authz2.ID = orde...
go
func (ssa *SQLStorageAuthority) GetValidOrderAuthorizations2(ctx context.Context, req *sapb.GetValidOrderAuthorizationsRequest) (*sapb.Authorizations, error) { var ams []authz2Model _, err := ssa.dbMap.WithContext(ctx).Select( &ams, fmt.Sprintf(`SELECT %s FROM authz2 LEFT JOIN orderToAuthz2 ON authz2.ID = orde...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetValidOrderAuthorizations2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetValidOrderAuthorizationsRequest", ")", "(", "*", "sapb", ".", "Authorizations", ",", "error", ")", "{", ...
// GetValidOrderAuthorizations2 is used to find the valid, unexpired authorizations // associated with a specific order and account ID. This method is intended to // deprecate GetValidOrderAuthorizations.
[ "GetValidOrderAuthorizations2", "is", "used", "to", "find", "the", "valid", "unexpired", "authorizations", "associated", "with", "a", "specific", "order", "and", "account", "ID", ".", "This", "method", "is", "intended", "to", "deprecate", "GetValidOrderAuthorizations"...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2543-L2600
31,040
letsencrypt/boulder
sa/sa.go
CountInvalidAuthorizations2
func (ssa *SQLStorageAuthority) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM authz2 WHERE registrationID = :regID AND identifierValue = :ident AND ...
go
func (ssa *SQLStorageAuthority) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error) { var count int64 err := ssa.dbMap.WithContext(ctx).SelectOne( &count, `SELECT COUNT(1) FROM authz2 WHERE registrationID = :regID AND identifierValue = :ident AND ...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "CountInvalidAuthorizations2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "CountInvalidAuthorizationsRequest", ")", "(", "*", "sapb", ".", "Count", ",", "error", ")", "{", "var", ...
// CountInvalidAuthorizations2 counts invalid authorizations for a user expiring // in a given time range. This method is intended to deprecate CountInvalidAuthorizations.
[ "CountInvalidAuthorizations2", "counts", "invalid", "authorizations", "for", "a", "user", "expiring", "in", "a", "given", "time", "range", ".", "This", "method", "is", "intended", "to", "deprecate", "CountInvalidAuthorizations", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2604-L2633
31,041
letsencrypt/boulder
sa/sa.go
GetValidAuthorizations2
func (ssa *SQLStorageAuthority) GetValidAuthorizations2(ctx context.Context, req *sapb.GetValidAuthorizationsRequest) (*sapb.Authorizations, error) { var authzModels []authz2Model params := []interface{}{ *req.RegistrationID, time.Unix(0, *req.Now), statusUint(core.StatusValid), } qmarks := make([]string, len...
go
func (ssa *SQLStorageAuthority) GetValidAuthorizations2(ctx context.Context, req *sapb.GetValidAuthorizationsRequest) (*sapb.Authorizations, error) { var authzModels []authz2Model params := []interface{}{ *req.RegistrationID, time.Unix(0, *req.Now), statusUint(core.StatusValid), } qmarks := make([]string, len...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "GetValidAuthorizations2", "(", "ctx", "context", ".", "Context", ",", "req", "*", "sapb", ".", "GetValidAuthorizationsRequest", ")", "(", "*", "sapb", ".", "Authorizations", ",", "error", ")", "{", "var", ...
// GetValidAuthorizations2 returns the latest authorization for all // domain names that the account has authorizations for. This method is // intended to deprecate GetValidAuthorizations.
[ "GetValidAuthorizations2", "returns", "the", "latest", "authorization", "for", "all", "domain", "names", "that", "the", "account", "has", "authorizations", "for", ".", "This", "method", "is", "intended", "to", "deprecate", "GetValidAuthorizations", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/sa.go#L2638-L2717
31,042
letsencrypt/boulder
va/utf8filter.go
replaceInvalidUTF8
func replaceInvalidUTF8(input []byte) string { var b strings.Builder // Ranging over a string in Go produces runes. When the range keyword // encounters an invalid UTF-8 encoding, it returns REPLACEMENT CHARACTER. for _, v := range string(input) { b.WriteRune(v) } return b.String() }
go
func replaceInvalidUTF8(input []byte) string { var b strings.Builder // Ranging over a string in Go produces runes. When the range keyword // encounters an invalid UTF-8 encoding, it returns REPLACEMENT CHARACTER. for _, v := range string(input) { b.WriteRune(v) } return b.String() }
[ "func", "replaceInvalidUTF8", "(", "input", "[", "]", "byte", ")", "string", "{", "var", "b", "strings", ".", "Builder", "\n\n", "// Ranging over a string in Go produces runes. When the range keyword", "// encounters an invalid UTF-8 encoding, it returns REPLACEMENT CHARACTER.", ...
// replaceInvalidUTF8 replaces all invalid UTF-8 encodings with // Unicode REPLACEMENT CHARACTER.
[ "replaceInvalidUTF8", "replaces", "all", "invalid", "UTF", "-", "8", "encodings", "with", "Unicode", "REPLACEMENT", "CHARACTER", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/utf8filter.go#L7-L16
31,043
letsencrypt/boulder
publisher/publisher.go
Len
func (c *logCache) Len() int { c.RLock() defer c.RUnlock() return len(c.logs) }
go
func (c *logCache) Len() int { c.RLock() defer c.RUnlock() return len(c.logs) }
[ "func", "(", "c", "*", "logCache", ")", "Len", "(", ")", "int", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n", "return", "len", "(", "c", ".", "logs", ")", "\n", "}" ]
// Len returns the number of logs in the logCache
[ "Len", "returns", "the", "number", "of", "logs", "in", "the", "logCache" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/publisher.go#L76-L80
31,044
letsencrypt/boulder
publisher/publisher.go
LogURIs
func (c *logCache) LogURIs() []string { c.RLock() defer c.RUnlock() var uris []string for _, l := range c.logs { uris = append(uris, l.uri) } return uris }
go
func (c *logCache) LogURIs() []string { c.RLock() defer c.RUnlock() var uris []string for _, l := range c.logs { uris = append(uris, l.uri) } return uris }
[ "func", "(", "c", "*", "logCache", ")", "LogURIs", "(", ")", "[", "]", "string", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n", "var", "uris", "[", "]", "string", "\n", "for", "_", ",", "l", ":=", "range...
// LogURIs returns the URIs of all logs currently in the logCache
[ "LogURIs", "returns", "the", "URIs", "of", "all", "logs", "currently", "in", "the", "logCache" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/publisher.go#L83-L91
31,045
letsencrypt/boulder
publisher/publisher.go
NewLog
func NewLog(uri, b64PK string, logger blog.Logger) (*Log, error) { url, err := url.Parse(uri) if err != nil { return nil, err } url.Path = strings.TrimSuffix(url.Path, "/") pemPK := fmt.Sprintf("-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----", b64PK) opts := jsonclient.Options{ Logger: logAdap...
go
func NewLog(uri, b64PK string, logger blog.Logger) (*Log, error) { url, err := url.Parse(uri) if err != nil { return nil, err } url.Path = strings.TrimSuffix(url.Path, "/") pemPK := fmt.Sprintf("-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----", b64PK) opts := jsonclient.Options{ Logger: logAdap...
[ "func", "NewLog", "(", "uri", ",", "b64PK", "string", ",", "logger", "blog", ".", "Logger", ")", "(", "*", "Log", ",", "error", ")", "{", "url", ",", "err", ":=", "url", ".", "Parse", "(", "uri", ")", "\n", "if", "err", "!=", "nil", "{", "retur...
// NewLog returns an initialized Log struct
[ "NewLog", "returns", "an", "initialized", "Log", "struct" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/publisher.go#L102-L162
31,046
letsencrypt/boulder
publisher/publisher.go
New
func New( bundle []ct.ASN1Cert, logger blog.Logger, stats metrics.Scope, ) *Impl { return &Impl{ issuerBundle: bundle, ctLogsCache: logCache{ logs: make(map[string]*Log), }, log: logger, metrics: initMetrics(stats), } }
go
func New( bundle []ct.ASN1Cert, logger blog.Logger, stats metrics.Scope, ) *Impl { return &Impl{ issuerBundle: bundle, ctLogsCache: logCache{ logs: make(map[string]*Log), }, log: logger, metrics: initMetrics(stats), } }
[ "func", "New", "(", "bundle", "[", "]", "ct", ".", "ASN1Cert", ",", "logger", "blog", ".", "Logger", ",", "stats", "metrics", ".", "Scope", ",", ")", "*", "Impl", "{", "return", "&", "Impl", "{", "issuerBundle", ":", "bundle", ",", "ctLogsCache", ":"...
// New creates a Publisher that will submit certificates // to requested CT logs
[ "New", "creates", "a", "Publisher", "that", "will", "submit", "certificates", "to", "requested", "CT", "logs" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/publisher.go#L210-L223
31,047
letsencrypt/boulder
publisher/publisher.go
ProbeLogs
func (pub *Impl) ProbeLogs() { wg := new(sync.WaitGroup) for _, log := range pub.ctLogsCache.LogURIs() { wg.Add(1) go func(uri string) { defer wg.Done() c := http.Client{ Timeout: time.Minute*2 + time.Second*30, } url, err := url.Parse(uri) if err != nil { pub.log.Errf("failed to parse log ...
go
func (pub *Impl) ProbeLogs() { wg := new(sync.WaitGroup) for _, log := range pub.ctLogsCache.LogURIs() { wg.Add(1) go func(uri string) { defer wg.Done() c := http.Client{ Timeout: time.Minute*2 + time.Second*30, } url, err := url.Parse(uri) if err != nil { pub.log.Errf("failed to parse log ...
[ "func", "(", "pub", "*", "Impl", ")", "ProbeLogs", "(", ")", "{", "wg", ":=", "new", "(", "sync", ".", "WaitGroup", ")", "\n", "for", "_", ",", "log", ":=", "range", "pub", ".", "ctLogsCache", ".", "LogURIs", "(", ")", "{", "wg", ".", "Add", "(...
// ProbeLogs sends a HTTP GET request to each of the logs in the // publisher logCache and records the latency and status of the // response.
[ "ProbeLogs", "sends", "a", "HTTP", "GET", "request", "to", "each", "of", "the", "logs", "in", "the", "publisher", "logCache", "and", "records", "the", "latency", "and", "status", "of", "the", "response", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/publisher/publisher.go#L414-L445
31,048
letsencrypt/boulder
csr/csr.go
VerifyCSR
func VerifyCSR(csr *x509.CertificateRequest, maxNames int, keyPolicy *goodkey.KeyPolicy, pa core.PolicyAuthority, forceCNFromSAN bool, regID int64) error { normalizeCSR(csr, forceCNFromSAN) key, ok := csr.PublicKey.(crypto.PublicKey) if !ok { return invalidPubKey } if err := keyPolicy.GoodKey(key); err != nil { ...
go
func VerifyCSR(csr *x509.CertificateRequest, maxNames int, keyPolicy *goodkey.KeyPolicy, pa core.PolicyAuthority, forceCNFromSAN bool, regID int64) error { normalizeCSR(csr, forceCNFromSAN) key, ok := csr.PublicKey.(crypto.PublicKey) if !ok { return invalidPubKey } if err := keyPolicy.GoodKey(key); err != nil { ...
[ "func", "VerifyCSR", "(", "csr", "*", "x509", ".", "CertificateRequest", ",", "maxNames", "int", ",", "keyPolicy", "*", "goodkey", ".", "KeyPolicy", ",", "pa", "core", ".", "PolicyAuthority", ",", "forceCNFromSAN", "bool", ",", "regID", "int64", ")", "error"...
// VerifyCSR checks the validity of a x509.CertificateRequest. Before doing checks it normalizes // the CSR which lowers the case of DNS names and subject CN, and if forceCNFromSAN is true it // will hoist a DNS name into the CN if it is empty.
[ "VerifyCSR", "checks", "the", "validity", "of", "a", "x509", ".", "CertificateRequest", ".", "Before", "doing", "checks", "it", "normalizes", "the", "CSR", "which", "lowers", "the", "case", "of", "DNS", "names", "and", "subject", "CN", "and", "if", "forceCNF...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/csr/csr.go#L46-L91
31,049
letsencrypt/boulder
csr/csr.go
normalizeCSR
func normalizeCSR(csr *x509.CertificateRequest, forceCNFromSAN bool) { if forceCNFromSAN && csr.Subject.CommonName == "" { if len(csr.DNSNames) > 0 { csr.Subject.CommonName = csr.DNSNames[0] } } else if csr.Subject.CommonName != "" { csr.DNSNames = append(csr.DNSNames, csr.Subject.CommonName) } csr.Subject...
go
func normalizeCSR(csr *x509.CertificateRequest, forceCNFromSAN bool) { if forceCNFromSAN && csr.Subject.CommonName == "" { if len(csr.DNSNames) > 0 { csr.Subject.CommonName = csr.DNSNames[0] } } else if csr.Subject.CommonName != "" { csr.DNSNames = append(csr.DNSNames, csr.Subject.CommonName) } csr.Subject...
[ "func", "normalizeCSR", "(", "csr", "*", "x509", ".", "CertificateRequest", ",", "forceCNFromSAN", "bool", ")", "{", "if", "forceCNFromSAN", "&&", "csr", ".", "Subject", ".", "CommonName", "==", "\"", "\"", "{", "if", "len", "(", "csr", ".", "DNSNames", ...
// normalizeCSR deduplicates and lowers the case of dNSNames and the subject CN. // If forceCNFromSAN is true it will also hoist a dNSName into the CN if it is empty.
[ "normalizeCSR", "deduplicates", "and", "lowers", "the", "case", "of", "dNSNames", "and", "the", "subject", "CN", ".", "If", "forceCNFromSAN", "is", "true", "it", "will", "also", "hoist", "a", "dNSName", "into", "the", "CN", "if", "it", "is", "empty", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/csr/csr.go#L95-L105
31,050
letsencrypt/boulder
goodkey/good_key.go
NewKeyPolicy
func NewKeyPolicy(weakKeyFile string) (KeyPolicy, error) { kp := KeyPolicy{ AllowRSA: true, AllowECDSANISTP256: true, AllowECDSANISTP384: true, } if weakKeyFile != "" { keyList, err := LoadWeakRSASuffixes(weakKeyFile) if err != nil { return KeyPolicy{}, err } kp.weakRSAList = keyList } r...
go
func NewKeyPolicy(weakKeyFile string) (KeyPolicy, error) { kp := KeyPolicy{ AllowRSA: true, AllowECDSANISTP256: true, AllowECDSANISTP384: true, } if weakKeyFile != "" { keyList, err := LoadWeakRSASuffixes(weakKeyFile) if err != nil { return KeyPolicy{}, err } kp.weakRSAList = keyList } r...
[ "func", "NewKeyPolicy", "(", "weakKeyFile", "string", ")", "(", "KeyPolicy", ",", "error", ")", "{", "kp", ":=", "KeyPolicy", "{", "AllowRSA", ":", "true", ",", "AllowECDSANISTP256", ":", "true", ",", "AllowECDSANISTP384", ":", "true", ",", "}", "\n", "if"...
// NewKeyPolicy returns a KeyPolicy that allows RSA, ECDSA256 and ECDSA384. // weakKeyFile contains the path to a JSON file containing truncated modulus // hashes of known weak RSA keys. If this argument is empty RSA modulus hash // checking will be disabled.
[ "NewKeyPolicy", "returns", "a", "KeyPolicy", "that", "allows", "RSA", "ECDSA256", "and", "ECDSA384", ".", "weakKeyFile", "contains", "the", "path", "to", "a", "JSON", "file", "containing", "truncated", "modulus", "hashes", "of", "known", "weak", "RSA", "keys", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/goodkey/good_key.go#L50-L64
31,051
letsencrypt/boulder
goodkey/good_key.go
checkSmallPrimes
func checkSmallPrimes(i *big.Int) bool { smallPrimesSingleton.Do(func() { for _, prime := range smallPrimeInts { smallPrimes = append(smallPrimes, big.NewInt(prime)) } }) for _, prime := range smallPrimes { var result big.Int result.Mod(i, prime) if result.Sign() == 0 { return true } } return f...
go
func checkSmallPrimes(i *big.Int) bool { smallPrimesSingleton.Do(func() { for _, prime := range smallPrimeInts { smallPrimes = append(smallPrimes, big.NewInt(prime)) } }) for _, prime := range smallPrimes { var result big.Int result.Mod(i, prime) if result.Sign() == 0 { return true } } return f...
[ "func", "checkSmallPrimes", "(", "i", "*", "big", ".", "Int", ")", "bool", "{", "smallPrimesSingleton", ".", "Do", "(", "func", "(", ")", "{", "for", "_", ",", "prime", ":=", "range", "smallPrimeInts", "{", "smallPrimes", "=", "append", "(", "smallPrimes...
// Returns true iff integer i is divisible by any of the primes in smallPrimes. // // Short circuits; execution time is dependent on i. Do not use this on secret // values.
[ "Returns", "true", "iff", "integer", "i", "is", "divisible", "by", "any", "of", "the", "primes", "in", "smallPrimes", ".", "Short", "circuits", ";", "execution", "time", "is", "dependent", "on", "i", ".", "Do", "not", "use", "this", "on", "secret", "valu...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/goodkey/good_key.go#L249-L265
31,052
letsencrypt/boulder
metrics/mock_metrics/mock_scope.go
NewMockScope
func NewMockScope(ctrl *gomock.Controller) *MockScope { mock := &MockScope{ctrl: ctrl} mock.recorder = &MockScopeMockRecorder{mock} return mock }
go
func NewMockScope(ctrl *gomock.Controller) *MockScope { mock := &MockScope{ctrl: ctrl} mock.recorder = &MockScopeMockRecorder{mock} return mock }
[ "func", "NewMockScope", "(", "ctrl", "*", "gomock", ".", "Controller", ")", "*", "MockScope", "{", "mock", ":=", "&", "MockScope", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockScopeMockRecorder", "{", "mock", "}", "\n", ...
// NewMockScope creates a new mock instance
[ "NewMockScope", "creates", "a", "new", "mock", "instance" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/metrics/mock_metrics/mock_scope.go#L27-L31
31,053
letsencrypt/boulder
metrics/mock_metrics/mock_scope.go
MustRegister
func (m *MockScope) MustRegister(arg0 ...prometheus.Collector) { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range arg0 { varargs = append(varargs, a) } m.ctrl.Call(m, "MustRegister", varargs...) }
go
func (m *MockScope) MustRegister(arg0 ...prometheus.Collector) { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range arg0 { varargs = append(varargs, a) } m.ctrl.Call(m, "MustRegister", varargs...) }
[ "func", "(", "m", "*", "MockScope", ")", "MustRegister", "(", "arg0", "...", "prometheus", ".", "Collector", ")", "{", "m", ".", "ctrl", ".", "T", ".", "Helper", "(", ")", "\n", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "}", "\n", "f...
// MustRegister mocks base method
[ "MustRegister", "mocks", "base", "method" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/metrics/mock_metrics/mock_scope.go#L75-L82
31,054
letsencrypt/boulder
metrics/mock_metrics/mock_scope.go
NewScope
func (m *MockScope) NewScope(arg0 ...string) metrics.Scope { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range arg0 { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "NewScope", varargs...) ret0, _ := ret[0].(metrics.Scope) return ret0 }
go
func (m *MockScope) NewScope(arg0 ...string) metrics.Scope { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range arg0 { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "NewScope", varargs...) ret0, _ := ret[0].(metrics.Scope) return ret0 }
[ "func", "(", "m", "*", "MockScope", ")", "NewScope", "(", "arg0", "...", "string", ")", "metrics", ".", "Scope", "{", "m", ".", "ctrl", ".", "T", ".", "Helper", "(", ")", "\n", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "}", "\n", "...
// NewScope mocks base method
[ "NewScope", "mocks", "base", "method" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/metrics/mock_metrics/mock_scope.go#L91-L100
31,055
letsencrypt/boulder
metrics/mock_metrics/mock_scope.go
TimingDuration
func (m *MockScope) TimingDuration(arg0 string, arg1 time.Duration) { m.ctrl.T.Helper() m.ctrl.Call(m, "TimingDuration", arg0, arg1) }
go
func (m *MockScope) TimingDuration(arg0 string, arg1 time.Duration) { m.ctrl.T.Helper() m.ctrl.Call(m, "TimingDuration", arg0, arg1) }
[ "func", "(", "m", "*", "MockScope", ")", "TimingDuration", "(", "arg0", "string", ",", "arg1", "time", ".", "Duration", ")", "{", "m", ".", "ctrl", ".", "T", ".", "Helper", "(", ")", "\n", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"...
// TimingDuration mocks base method
[ "TimingDuration", "mocks", "base", "method" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/metrics/mock_metrics/mock_scope.go#L133-L136
31,056
letsencrypt/boulder
sa/rate_limits.go
baseDomain
func baseDomain(name string) string { eTLDPlusOne, err := publicsuffix.Domain(name) if err != nil { // publicsuffix.Domain will return an error if the input name is itself a // public suffix. In that case we use the input name as the key for rate // limiting. Since all of its subdomains will have separate keys ...
go
func baseDomain(name string) string { eTLDPlusOne, err := publicsuffix.Domain(name) if err != nil { // publicsuffix.Domain will return an error if the input name is itself a // public suffix. In that case we use the input name as the key for rate // limiting. Since all of its subdomains will have separate keys ...
[ "func", "baseDomain", "(", "name", "string", ")", "string", "{", "eTLDPlusOne", ",", "err", ":=", "publicsuffix", ".", "Domain", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "// publicsuffix.Domain will return an error if the input name is itself a", "// p...
// baseDomain returns the eTLD+1 of a domain name for the purpose of rate // limiting. For a domain name that is itself an eTLD, it returns its input.
[ "baseDomain", "returns", "the", "eTLD", "+", "1", "of", "a", "domain", "name", "for", "the", "purpose", "of", "rate", "limiting", ".", "For", "a", "domain", "name", "that", "is", "itself", "an", "eTLD", "it", "returns", "its", "input", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/rate_limits.go#L15-L29
31,057
letsencrypt/boulder
sa/rate_limits.go
addCertificatesPerName
func (ssa *SQLStorageAuthority) addCertificatesPerName( ctx context.Context, db dbSelectExecer, names []string, timeToTheHour time.Time, ) error { if !features.Enabled(features.FasterRateLimit) { return nil } // De-duplicate the base domains. baseDomainsMap := make(map[string]bool) var qmarks []string var v...
go
func (ssa *SQLStorageAuthority) addCertificatesPerName( ctx context.Context, db dbSelectExecer, names []string, timeToTheHour time.Time, ) error { if !features.Enabled(features.FasterRateLimit) { return nil } // De-duplicate the base domains. baseDomainsMap := make(map[string]bool) var qmarks []string var v...
[ "func", "(", "ssa", "*", "SQLStorageAuthority", ")", "addCertificatesPerName", "(", "ctx", "context", ".", "Context", ",", "db", "dbSelectExecer", ",", "names", "[", "]", "string", ",", "timeToTheHour", "time", ".", "Time", ",", ")", "error", "{", "if", "!...
// addCertificatesPerName adds 1 to the rate limit count for the provided domains, // in a specific time bucket. It must be executed in a transaction, and the // input timeToTheHour must be a time rounded to an hour.
[ "addCertificatesPerName", "adds", "1", "to", "the", "rate", "limit", "count", "for", "the", "provided", "domains", "in", "a", "specific", "time", "bucket", ".", "It", "must", "be", "executed", "in", "a", "transaction", "and", "the", "input", "timeToTheHour", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/rate_limits.go#L34-L64
31,058
letsencrypt/boulder
cmd/gen-ca/main.go
getKey
func getKey(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label string, idStr string) (*x509Signer, error) { id, err := hex.DecodeString(idStr) if err != nil { return nil, err } // Retrieve the private key handle that will later be used for the certificate // signing operation privateHandle, err := fi...
go
func getKey(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label string, idStr string) (*x509Signer, error) { id, err := hex.DecodeString(idStr) if err != nil { return nil, err } // Retrieve the private key handle that will later be used for the certificate // signing operation privateHandle, err := fi...
[ "func", "getKey", "(", "ctx", "pkcs11helpers", ".", "PKCtx", ",", "session", "pkcs11", ".", "SessionHandle", ",", "label", "string", ",", "idStr", "string", ")", "(", "*", "x509Signer", ",", "error", ")", "{", "id", ",", "err", ":=", "hex", ".", "Decod...
// getKey constructs a x509Signer for the private key object associated with the // given label and ID
[ "getKey", "constructs", "a", "x509Signer", "for", "the", "private", "key", "object", "associated", "with", "the", "given", "label", "and", "ID" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-ca/main.go#L96-L161
31,059
letsencrypt/boulder
cmd/gen-ca/main.go
makeTemplate
func makeTemplate(ctx pkcs11helpers.PKCtx, profile *CertProfile, pubKey []byte, session pkcs11.SessionHandle) (*x509.Certificate, error) { dateLayout := "2006-01-02 15:04:05" notBefore, err := time.Parse(dateLayout, profile.NotBefore) if err != nil { return nil, err } notAfter, err := time.Parse(dateLayout, prof...
go
func makeTemplate(ctx pkcs11helpers.PKCtx, profile *CertProfile, pubKey []byte, session pkcs11.SessionHandle) (*x509.Certificate, error) { dateLayout := "2006-01-02 15:04:05" notBefore, err := time.Parse(dateLayout, profile.NotBefore) if err != nil { return nil, err } notAfter, err := time.Parse(dateLayout, prof...
[ "func", "makeTemplate", "(", "ctx", "pkcs11helpers", ".", "PKCtx", ",", "profile", "*", "CertProfile", ",", "pubKey", "[", "]", "byte", ",", "session", "pkcs11", ".", "SessionHandle", ")", "(", "*", "x509", ".", "Certificate", ",", "error", ")", "{", "da...
// makeTemplate generates the certificate template for use in x509.CreateCertificate
[ "makeTemplate", "generates", "the", "certificate", "template", "for", "use", "in", "x509", ".", "CreateCertificate" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-ca/main.go#L257-L323
31,060
letsencrypt/boulder
cmd/ocsp-updater/main.go
generateRevokedResponse
func (updater *OCSPUpdater) generateRevokedResponse(ctx context.Context, status core.CertificateStatus) (*core.CertificateStatus, []string, error) { cert, err := updater.sac.GetCertificate(ctx, status.Serial) if err != nil { return nil, nil, err } signRequest := core.OCSPSigningRequest{ CertDER: cert.DER, ...
go
func (updater *OCSPUpdater) generateRevokedResponse(ctx context.Context, status core.CertificateStatus) (*core.CertificateStatus, []string, error) { cert, err := updater.sac.GetCertificate(ctx, status.Serial) if err != nil { return nil, nil, err } signRequest := core.OCSPSigningRequest{ CertDER: cert.DER, ...
[ "func", "(", "updater", "*", "OCSPUpdater", ")", "generateRevokedResponse", "(", "ctx", "context", ".", "Context", ",", "status", "core", ".", "CertificateStatus", ")", "(", "*", "core", ".", "CertificateStatus", ",", "[", "]", "string", ",", "error", ")", ...
// generateRevokedResponse takes a core.CertificateStatus and updates it with a revoked OCSP response // for the certificate it represents. generateRevokedResponse then returns the updated status and a // list of OCSP request URLs that should be purged or an error.
[ "generateRevokedResponse", "takes", "a", "core", ".", "CertificateStatus", "and", "updates", "it", "with", "a", "revoked", "OCSP", "response", "for", "the", "certificate", "it", "represents", ".", "generateRevokedResponse", "then", "returns", "the", "updated", "stat...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/ocsp-updater/main.go#L235-L267
31,061
letsencrypt/boulder
cmd/ocsp-updater/main.go
markExpired
func (updater *OCSPUpdater) markExpired(status core.CertificateStatus) error { _, err := updater.dbMap.Exec( `UPDATE certificateStatus SET isExpired = TRUE WHERE serial = ?`, status.Serial, ) return err }
go
func (updater *OCSPUpdater) markExpired(status core.CertificateStatus) error { _, err := updater.dbMap.Exec( `UPDATE certificateStatus SET isExpired = TRUE WHERE serial = ?`, status.Serial, ) return err }
[ "func", "(", "updater", "*", "OCSPUpdater", ")", "markExpired", "(", "status", "core", ".", "CertificateStatus", ")", "error", "{", "_", ",", "err", ":=", "updater", ".", "dbMap", ".", "Exec", "(", "`UPDATE certificateStatus\n \t\tSET isExpired = TRUE\n \t\tWHERE se...
// markExpired updates a given CertificateStatus to have `isExpired` set.
[ "markExpired", "updates", "a", "given", "CertificateStatus", "to", "have", "isExpired", "set", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/ocsp-updater/main.go#L288-L296
31,062
letsencrypt/boulder
sa/metrics.go
InitDBMetrics
func InitDBMetrics(dbMap *gorp.DbMap, scope metrics.Scope) { // Create a dbMetrics instance and register prometheus metrics dbm := newDbMetrics(dbMap, scope) // Start the metric reporting goroutine to update the metrics periodically. go dbm.reportDBMetrics() }
go
func InitDBMetrics(dbMap *gorp.DbMap, scope metrics.Scope) { // Create a dbMetrics instance and register prometheus metrics dbm := newDbMetrics(dbMap, scope) // Start the metric reporting goroutine to update the metrics periodically. go dbm.reportDBMetrics() }
[ "func", "InitDBMetrics", "(", "dbMap", "*", "gorp", ".", "DbMap", ",", "scope", "metrics", ".", "Scope", ")", "{", "// Create a dbMetrics instance and register prometheus metrics", "dbm", ":=", "newDbMetrics", "(", "dbMap", ",", "scope", ")", "\n\n", "// Start the m...
// InitDBMetrics will register prometheus stats for the provided dbMap under the // given metrics.Scope. Every 1 second in a separate go routine the prometheus // stats will be updated based on the gorp dbMap's inner sql.DBMap's DBStats // structure values.
[ "InitDBMetrics", "will", "register", "prometheus", "stats", "for", "the", "provided", "dbMap", "under", "the", "given", "metrics", ".", "Scope", ".", "Every", "1", "second", "in", "a", "separate", "go", "routine", "the", "prometheus", "stats", "will", "be", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/metrics.go#L30-L36
31,063
letsencrypt/boulder
sa/metrics.go
newDbMetrics
func newDbMetrics(dbMap *gorp.DbMap, scope metrics.Scope) *dbMetrics { maxOpenConns := prometheus.NewGauge(prometheus.GaugeOpts{ Name: "db_max_open_connections", Help: "Maximum number of DB connections allowed.", }) scope.MustRegister(maxOpenConns) openConns := prometheus.NewGauge(prometheus.GaugeOpts{ Name:...
go
func newDbMetrics(dbMap *gorp.DbMap, scope metrics.Scope) *dbMetrics { maxOpenConns := prometheus.NewGauge(prometheus.GaugeOpts{ Name: "db_max_open_connections", Help: "Maximum number of DB connections allowed.", }) scope.MustRegister(maxOpenConns) openConns := prometheus.NewGauge(prometheus.GaugeOpts{ Name:...
[ "func", "newDbMetrics", "(", "dbMap", "*", "gorp", ".", "DbMap", ",", "scope", "metrics", ".", "Scope", ")", "*", "dbMetrics", "{", "maxOpenConns", ":=", "prometheus", ".", "NewGauge", "(", "prometheus", ".", "GaugeOpts", "{", "Name", ":", "\"", "\"", ",...
// newDbMetrics constructs a dbMetrics instance by registering prometheus stats.
[ "newDbMetrics", "constructs", "a", "dbMetrics", "instance", "by", "registering", "prometheus", "stats", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/metrics.go#L39-L101
31,064
letsencrypt/boulder
sa/metrics.go
updateFrom
func (dbm *dbMetrics) updateFrom(dbStats sql.DBStats) { dbm.maxOpenConnections.Set(float64(dbStats.MaxOpenConnections)) dbm.openConnections.Set(float64(dbStats.OpenConnections)) dbm.inUse.Set(float64(dbStats.InUse)) dbm.idle.Set(float64(dbStats.InUse)) dbm.waitCount.Set(float64(dbStats.WaitCount)) dbm.waitDuratio...
go
func (dbm *dbMetrics) updateFrom(dbStats sql.DBStats) { dbm.maxOpenConnections.Set(float64(dbStats.MaxOpenConnections)) dbm.openConnections.Set(float64(dbStats.OpenConnections)) dbm.inUse.Set(float64(dbStats.InUse)) dbm.idle.Set(float64(dbStats.InUse)) dbm.waitCount.Set(float64(dbStats.WaitCount)) dbm.waitDuratio...
[ "func", "(", "dbm", "*", "dbMetrics", ")", "updateFrom", "(", "dbStats", "sql", ".", "DBStats", ")", "{", "dbm", ".", "maxOpenConnections", ".", "Set", "(", "float64", "(", "dbStats", ".", "MaxOpenConnections", ")", ")", "\n", "dbm", ".", "openConnections"...
// updateFrom updates the dbMetrics prometheus stats based on the provided // sql.DBStats object.
[ "updateFrom", "updates", "the", "dbMetrics", "prometheus", "stats", "based", "on", "the", "provided", "sql", ".", "DBStats", "object", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/metrics.go#L105-L114
31,065
letsencrypt/boulder
sa/metrics.go
reportDBMetrics
func (dbm *dbMetrics) reportDBMetrics() { for { stats := dbm.dbMap.Db.Stats() dbm.updateFrom(stats) time.Sleep(1 * time.Second) } }
go
func (dbm *dbMetrics) reportDBMetrics() { for { stats := dbm.dbMap.Db.Stats() dbm.updateFrom(stats) time.Sleep(1 * time.Second) } }
[ "func", "(", "dbm", "*", "dbMetrics", ")", "reportDBMetrics", "(", ")", "{", "for", "{", "stats", ":=", "dbm", ".", "dbMap", ".", "Db", ".", "Stats", "(", ")", "\n", "dbm", ".", "updateFrom", "(", "stats", ")", "\n", "time", ".", "Sleep", "(", "1...
// reportDBMetrics is an infinite loop that will update the dbm with the gorp // dbMap's inner sql.DBMap's DBStats structure every second. It is intended to // be run in a dedicated goroutine spawned by InitDBMetrics.
[ "reportDBMetrics", "is", "an", "infinite", "loop", "that", "will", "update", "the", "dbm", "with", "the", "gorp", "dbMap", "s", "inner", "sql", ".", "DBMap", "s", "DBStats", "structure", "every", "second", ".", "It", "is", "intended", "to", "be", "run", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/metrics.go#L119-L125
31,066
letsencrypt/boulder
grpc/errors.go
unwrapError
func unwrapError(err error, md metadata.MD) error { if err == nil { return nil } if errTypeStrs, ok := md["errortype"]; ok { unwrappedErr := grpc.ErrorDesc(err) if len(errTypeStrs) != 1 { return berrors.InternalServerError( "multiple errorType metadata, wrapped error %q", unwrappedErr, ) } er...
go
func unwrapError(err error, md metadata.MD) error { if err == nil { return nil } if errTypeStrs, ok := md["errortype"]; ok { unwrappedErr := grpc.ErrorDesc(err) if len(errTypeStrs) != 1 { return berrors.InternalServerError( "multiple errorType metadata, wrapped error %q", unwrappedErr, ) } er...
[ "func", "unwrapError", "(", "err", "error", ",", "md", "metadata", ".", "MD", ")", "error", "{", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "errTypeStrs", ",", "ok", ":=", "md", "[", "\"", "\"", "]", ";", "ok", "{", ...
// unwrapError unwraps errors returned from gRPC client calls which were wrapped // with wrapError to their proper internal error type. If the provided metadata // object has an "errortype" field, that will be used to set the type of the // error.
[ "unwrapError", "unwraps", "errors", "returned", "from", "gRPC", "client", "calls", "which", "were", "wrapped", "with", "wrapError", "to", "their", "proper", "internal", "error", "type", ".", "If", "the", "provided", "metadata", "object", "has", "an", "errortype"...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/errors.go#L43-L66
31,067
letsencrypt/boulder
mail/mailer.go
New
func New( server, port, username, password string, rootCAs *x509.CertPool, from mail.Address, logger blog.Logger, stats metrics.Scope, reconnectBase time.Duration, reconnectMax time.Duration) *MailerImpl { return &MailerImpl{ dialer: &dialerImpl{ username: username, password: password, server: s...
go
func New( server, port, username, password string, rootCAs *x509.CertPool, from mail.Address, logger blog.Logger, stats metrics.Scope, reconnectBase time.Duration, reconnectMax time.Duration) *MailerImpl { return &MailerImpl{ dialer: &dialerImpl{ username: username, password: password, server: s...
[ "func", "New", "(", "server", ",", "port", ",", "username", ",", "password", "string", ",", "rootCAs", "*", "x509", ".", "CertPool", ",", "from", "mail", ".", "Address", ",", "logger", "blog", ".", "Logger", ",", "stats", "metrics", ".", "Scope", ",", ...
// New constructs a Mailer to represent an account on a particular mail // transfer agent.
[ "New", "constructs", "a", "Mailer", "to", "represent", "an", "account", "on", "a", "particular", "mail", "transfer", "agent", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mail/mailer.go#L116-L143
31,068
letsencrypt/boulder
mail/mailer.go
NewDryRun
func NewDryRun(from mail.Address, logger blog.Logger) *MailerImpl { stats := metrics.NewNoopScope() return &MailerImpl{ dialer: dryRunClient{logger}, from: from, clk: clock.Default(), csprgSource: realSource{}, stats: stats, } }
go
func NewDryRun(from mail.Address, logger blog.Logger) *MailerImpl { stats := metrics.NewNoopScope() return &MailerImpl{ dialer: dryRunClient{logger}, from: from, clk: clock.Default(), csprgSource: realSource{}, stats: stats, } }
[ "func", "NewDryRun", "(", "from", "mail", ".", "Address", ",", "logger", "blog", ".", "Logger", ")", "*", "MailerImpl", "{", "stats", ":=", "metrics", ".", "NewNoopScope", "(", ")", "\n", "return", "&", "MailerImpl", "{", "dialer", ":", "dryRunClient", "...
// New constructs a Mailer suitable for doing a dry run. It simply logs each // command that would have been run, at debug level.
[ "New", "constructs", "a", "Mailer", "suitable", "for", "doing", "a", "dry", "run", ".", "It", "simply", "logs", "each", "command", "that", "would", "have", "been", "run", "at", "debug", "level", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mail/mailer.go#L147-L156
31,069
letsencrypt/boulder
mail/mailer.go
Connect
func (m *MailerImpl) Connect() error { client, err := m.dialer.Dial() if err != nil { return err } m.client = client return nil }
go
func (m *MailerImpl) Connect() error { client, err := m.dialer.Dial() if err != nil { return err } m.client = client return nil }
[ "func", "(", "m", "*", "MailerImpl", ")", "Connect", "(", ")", "error", "{", "client", ",", "err", ":=", "m", ".", "dialer", ".", "Dial", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "m", ".", "client", "=", ...
// Connect opens a connection to the specified mail server. It must be called // before SendMail.
[ "Connect", "opens", "a", "connection", "to", "the", "specified", "mail", "server", ".", "It", "must", "be", "called", "before", "SendMail", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mail/mailer.go#L217-L224
31,070
letsencrypt/boulder
mail/mailer.go
SendMail
func (m *MailerImpl) SendMail(to []string, subject, msg string) error { m.stats.Inc("SendMail.Attempts", 1) for { err := m.sendOne(to, subject, msg) if err == nil { // If the error is nil, we sent the mail without issue. nice! break } else if err == io.EOF { // If the error is an EOF, we should try to...
go
func (m *MailerImpl) SendMail(to []string, subject, msg string) error { m.stats.Inc("SendMail.Attempts", 1) for { err := m.sendOne(to, subject, msg) if err == nil { // If the error is nil, we sent the mail without issue. nice! break } else if err == io.EOF { // If the error is an EOF, we should try to...
[ "func", "(", "m", "*", "MailerImpl", ")", "SendMail", "(", "to", "[", "]", "string", ",", "subject", ",", "msg", "string", ")", "error", "{", "m", ".", "stats", ".", "Inc", "(", "\"", "\"", ",", "1", ")", "\n\n", "for", "{", "err", ":=", "m", ...
// SendMail sends an email to the provided list of recipients. The email body // is simple text.
[ "SendMail", "sends", "an", "email", "to", "the", "provided", "list", "of", "recipients", ".", "The", "email", "body", "is", "simple", "text", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/mail/mailer.go#L327-L375
31,071
letsencrypt/boulder
sa/rollback.go
Rollback
func Rollback(tx *gorp.Transaction, err error) error { if txErr := tx.Rollback(); txErr != nil { return &RollbackError{ Err: err, RollbackErr: txErr, } } return err }
go
func Rollback(tx *gorp.Transaction, err error) error { if txErr := tx.Rollback(); txErr != nil { return &RollbackError{ Err: err, RollbackErr: txErr, } } return err }
[ "func", "Rollback", "(", "tx", "*", "gorp", ".", "Transaction", ",", "err", "error", ")", "error", "{", "if", "txErr", ":=", "tx", ".", "Rollback", "(", ")", ";", "txErr", "!=", "nil", "{", "return", "&", "RollbackError", "{", "Err", ":", "err", ",...
// Rollback rolls back the provided transaction. If the rollback fails for any // reason a `RollbackError` error is returned wrapping the original error. If no // rollback error occurs then the original error is returned.
[ "Rollback", "rolls", "back", "the", "provided", "transaction", ".", "If", "the", "rollback", "fails", "for", "any", "reason", "a", "RollbackError", "error", "is", "returned", "wrapping", "the", "original", "error", ".", "If", "no", "rollback", "error", "occurs...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/rollback.go#L32-L40
31,072
letsencrypt/boulder
ca/ca.go
noteSignError
func (ca *CertificateAuthorityImpl) noteSignError(err error) { if err != nil { if _, ok := err.(*pkcs11.Error); ok { ca.stats.Inc(metricHSMError, 1) } else if cfErr, ok := err.(*cferr.Error); ok { ca.stats.Inc(fmt.Sprintf("%s.%d", metricSigningError, cfErr.ErrorCode), 1) } } return }
go
func (ca *CertificateAuthorityImpl) noteSignError(err error) { if err != nil { if _, ok := err.(*pkcs11.Error); ok { ca.stats.Inc(metricHSMError, 1) } else if cfErr, ok := err.(*cferr.Error); ok { ca.stats.Inc(fmt.Sprintf("%s.%d", metricSigningError, cfErr.ErrorCode), 1) } } return }
[ "func", "(", "ca", "*", "CertificateAuthorityImpl", ")", "noteSignError", "(", "err", "error", ")", "{", "if", "err", "!=", "nil", "{", "if", "_", ",", "ok", ":=", "err", ".", "(", "*", "pkcs11", ".", "Error", ")", ";", "ok", "{", "ca", ".", "sta...
// noteSignError is called after operations that may cause a CFSSL // or PKCS11 signing error.
[ "noteSignError", "is", "called", "after", "operations", "that", "may", "cause", "a", "CFSSL", "or", "PKCS11", "signing", "error", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ca/ca.go#L305-L314
31,073
letsencrypt/boulder
ca/ca.go
GenerateOCSP
func (ca *CertificateAuthorityImpl) GenerateOCSP(ctx context.Context, xferObj core.OCSPSigningRequest) ([]byte, error) { cert, err := x509.ParseCertificate(xferObj.CertDER) if err != nil { ca.log.AuditErr(err.Error()) return nil, err } signRequest := ocsp.SignRequest{ Certificate: cert, Status: xferOb...
go
func (ca *CertificateAuthorityImpl) GenerateOCSP(ctx context.Context, xferObj core.OCSPSigningRequest) ([]byte, error) { cert, err := x509.ParseCertificate(xferObj.CertDER) if err != nil { ca.log.AuditErr(err.Error()) return nil, err } signRequest := ocsp.SignRequest{ Certificate: cert, Status: xferOb...
[ "func", "(", "ca", "*", "CertificateAuthorityImpl", ")", "GenerateOCSP", "(", "ctx", "context", ".", "Context", ",", "xferObj", "core", ".", "OCSPSigningRequest", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "cert", ",", "err", ":=", "x509", ".", ...
// GenerateOCSP produces a new OCSP response and returns it
[ "GenerateOCSP", "produces", "a", "new", "OCSP", "response", "and", "returns", "it" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ca/ca.go#L386-L419
31,074
letsencrypt/boulder
ca/ca.go
IssueCertificateForPrecertificate
func (ca *CertificateAuthorityImpl) IssueCertificateForPrecertificate(ctx context.Context, req *caPB.IssueCertificateForPrecertificateRequest) (core.Certificate, error) { emptyCert := core.Certificate{} precert, err := x509.ParseCertificate(req.DER) if err != nil { return emptyCert, err } var scts []ct.SignedCer...
go
func (ca *CertificateAuthorityImpl) IssueCertificateForPrecertificate(ctx context.Context, req *caPB.IssueCertificateForPrecertificateRequest) (core.Certificate, error) { emptyCert := core.Certificate{} precert, err := x509.ParseCertificate(req.DER) if err != nil { return emptyCert, err } var scts []ct.SignedCer...
[ "func", "(", "ca", "*", "CertificateAuthorityImpl", ")", "IssueCertificateForPrecertificate", "(", "ctx", "context", ".", "Context", ",", "req", "*", "caPB", ".", "IssueCertificateForPrecertificateRequest", ")", "(", "core", ".", "Certificate", ",", "error", ")", ...
// IssueCertificateForPrecertificate takes a precertificate and a set of SCTs for that precertificate // and uses the signer to create and sign a certificate from them. The poison extension is removed // and a SCT list extension is inserted in its place. Except for this and the signature the certificate // exactly matc...
[ "IssueCertificateForPrecertificate", "takes", "a", "precertificate", "and", "a", "set", "of", "SCTs", "for", "that", "precertificate", "and", "uses", "the", "signer", "to", "create", "and", "sign", "a", "certificate", "from", "them", ".", "The", "poison", "exten...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ca/ca.go#L473-L504
31,075
letsencrypt/boulder
ca/ca.go
OrphanIntegrationLoop
func (ca *CertificateAuthorityImpl) OrphanIntegrationLoop() { for { if err := ca.integrateOrphan(); err != nil { if err == goque.ErrEmpty { time.Sleep(time.Minute) continue } ca.log.AuditErrf("failed to integrate orphaned certs: %s", err) } } }
go
func (ca *CertificateAuthorityImpl) OrphanIntegrationLoop() { for { if err := ca.integrateOrphan(); err != nil { if err == goque.ErrEmpty { time.Sleep(time.Minute) continue } ca.log.AuditErrf("failed to integrate orphaned certs: %s", err) } } }
[ "func", "(", "ca", "*", "CertificateAuthorityImpl", ")", "OrphanIntegrationLoop", "(", ")", "{", "for", "{", "if", "err", ":=", "ca", ".", "integrateOrphan", "(", ")", ";", "err", "!=", "nil", "{", "if", "err", "==", "goque", ".", "ErrEmpty", "{", "tim...
// OrphanIntegrationLoop runs a loop executing integrateOrphans and then waiting a minute. // It is split out into a separate function called directly by boulder-ca in order to make // testing the orphan queue functionality somewhat more simple.
[ "OrphanIntegrationLoop", "runs", "a", "loop", "executing", "integrateOrphans", "and", "then", "waiting", "a", "minute", ".", "It", "is", "split", "out", "into", "a", "separate", "function", "called", "directly", "by", "boulder", "-", "ca", "in", "order", "to",...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ca/ca.go#L694-L704
31,076
letsencrypt/boulder
ca/ca.go
integrateOrphan
func (ca *CertificateAuthorityImpl) integrateOrphan() error { item, err := ca.orphanQueue.Peek() if err != nil { if err == goque.ErrEmpty { return goque.ErrEmpty } return fmt.Errorf("failed to peek into orphan queue: %s", err) } var orphan orphanedCert if err = item.ToObject(&orphan); err != nil { retur...
go
func (ca *CertificateAuthorityImpl) integrateOrphan() error { item, err := ca.orphanQueue.Peek() if err != nil { if err == goque.ErrEmpty { return goque.ErrEmpty } return fmt.Errorf("failed to peek into orphan queue: %s", err) } var orphan orphanedCert if err = item.ToObject(&orphan); err != nil { retur...
[ "func", "(", "ca", "*", "CertificateAuthorityImpl", ")", "integrateOrphan", "(", ")", "error", "{", "item", ",", "err", ":=", "ca", ".", "orphanQueue", ".", "Peek", "(", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "goque", ".", "ErrE...
// integrateOrpan removes an orphan from the queue and adds it to the database. The // item isn't dequeued until it is actually added to the database to prevent items from // being lost if the CA is restarted between the item being dequeued and being added to // the database. It calculates the issuance time by subtract...
[ "integrateOrpan", "removes", "an", "orphan", "from", "the", "queue", "and", "adds", "it", "to", "the", "database", ".", "The", "item", "isn", "t", "dequeued", "until", "it", "is", "actually", "added", "to", "the", "database", "to", "prevent", "items", "fro...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ca/ca.go#L711-L736
31,077
letsencrypt/boulder
wfe2/verify.go
enforceJWSAuthType
func (wfe *WebFrontEndImpl) enforceJWSAuthType( jws *jose.JSONWebSignature, expectedAuthType jwsAuthType) *probs.ProblemDetails { // Check the auth type for the provided JWS authType, prob := checkJWSAuthType(jws) if prob != nil { wfe.stats.joseErrorCount.With(prometheus.Labels{"type": "JWSAuthTypeInvalid"}).Inc...
go
func (wfe *WebFrontEndImpl) enforceJWSAuthType( jws *jose.JSONWebSignature, expectedAuthType jwsAuthType) *probs.ProblemDetails { // Check the auth type for the provided JWS authType, prob := checkJWSAuthType(jws) if prob != nil { wfe.stats.joseErrorCount.With(prometheus.Labels{"type": "JWSAuthTypeInvalid"}).Inc...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "enforceJWSAuthType", "(", "jws", "*", "jose", ".", "JSONWebSignature", ",", "expectedAuthType", "jwsAuthType", ")", "*", "probs", ".", "ProblemDetails", "{", "// Check the auth type for the provided JWS", "authType", "...
// enforceJWSAuthType enforces a provided JWS has the provided auth type. If there // is an error determining the auth type or if it is not the expected auth type // then a problem is returned.
[ "enforceJWSAuthType", "enforces", "a", "provided", "JWS", "has", "the", "provided", "auth", "type", ".", "If", "there", "is", "an", "error", "determining", "the", "auth", "type", "or", "if", "it", "is", "not", "the", "expected", "auth", "type", "then", "a"...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L114-L135
31,078
letsencrypt/boulder
wfe2/verify.go
validPOSTURL
func (wfe *WebFrontEndImpl) validPOSTURL( request *http.Request, jws *jose.JSONWebSignature) *probs.ProblemDetails { // validPOSTURL is called after parseJWS() which defends against the incorrect // number of signatures. header := jws.Signatures[0].Header extraHeaders := header.ExtraHeaders // Check that there i...
go
func (wfe *WebFrontEndImpl) validPOSTURL( request *http.Request, jws *jose.JSONWebSignature) *probs.ProblemDetails { // validPOSTURL is called after parseJWS() which defends against the incorrect // number of signatures. header := jws.Signatures[0].Header extraHeaders := header.ExtraHeaders // Check that there i...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "validPOSTURL", "(", "request", "*", "http", ".", "Request", ",", "jws", "*", "jose", ".", "JSONWebSignature", ")", "*", "probs", ".", "ProblemDetails", "{", "// validPOSTURL is called after parseJWS() which defends a...
// validPOSTURL checks the JWS' URL header against the expected URL based on the // HTTP request. This prevents a JWS intended for one endpoint being replayed // against a different endpoint. If the URL isn't present, is invalid, or // doesn't match the HTTP request a problem is returned.
[ "validPOSTURL", "checks", "the", "JWS", "URL", "header", "against", "the", "expected", "URL", "based", "on", "the", "HTTP", "request", ".", "This", "prevents", "a", "JWS", "intended", "for", "one", "endpoint", "being", "replayed", "against", "a", "different", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L199-L231
31,079
letsencrypt/boulder
wfe2/verify.go
matchJWSURLs
func (wfe *WebFrontEndImpl) matchJWSURLs(outer, inner *jose.JSONWebSignature) *probs.ProblemDetails { // Verify that the outer JWS has a non-empty URL header. This is strictly // defensive since the expectation is that endpoints using `matchJWSURLs` // have received at least one of their JWS from calling validPOSTFo...
go
func (wfe *WebFrontEndImpl) matchJWSURLs(outer, inner *jose.JSONWebSignature) *probs.ProblemDetails { // Verify that the outer JWS has a non-empty URL header. This is strictly // defensive since the expectation is that endpoints using `matchJWSURLs` // have received at least one of their JWS from calling validPOSTFo...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "matchJWSURLs", "(", "outer", ",", "inner", "*", "jose", ".", "JSONWebSignature", ")", "*", "probs", ".", "ProblemDetails", "{", "// Verify that the outer JWS has a non-empty URL header. This is strictly", "// defensive sin...
// matchJWSURLs checks two JWS' URL headers are equal. This is used during key // rollover to check that the inner JWS URL matches the outer JWS URL. If the // JWS URLs do not match a problem is returned.
[ "matchJWSURLs", "checks", "two", "JWS", "URL", "headers", "are", "equal", ".", "This", "is", "used", "during", "key", "rollover", "to", "check", "that", "the", "inner", "JWS", "URL", "matches", "the", "outer", "JWS", "URL", ".", "If", "the", "JWS", "URLs...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L236-L263
31,080
letsencrypt/boulder
wfe2/verify.go
parseJWSRequest
func (wfe *WebFrontEndImpl) parseJWSRequest(request *http.Request) (*jose.JSONWebSignature, *probs.ProblemDetails) { // Verify that the POST request has the expected headers if prob := wfe.validPOSTRequest(request); prob != nil { return nil, prob } // Read the POST request body's bytes. validPOSTRequest has alre...
go
func (wfe *WebFrontEndImpl) parseJWSRequest(request *http.Request) (*jose.JSONWebSignature, *probs.ProblemDetails) { // Verify that the POST request has the expected headers if prob := wfe.validPOSTRequest(request); prob != nil { return nil, prob } // Read the POST request body's bytes. validPOSTRequest has alre...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "parseJWSRequest", "(", "request", "*", "http", ".", "Request", ")", "(", "*", "jose", ".", "JSONWebSignature", ",", "*", "probs", ".", "ProblemDetails", ")", "{", "// Verify that the POST request has the expected h...
// parseJWSRequest extracts a JSONWebSignature from an HTTP POST request's body using parseJWS.
[ "parseJWSRequest", "extracts", "a", "JSONWebSignature", "from", "an", "HTTP", "POST", "request", "s", "body", "using", "parseJWS", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L326-L341
31,081
letsencrypt/boulder
wfe2/verify.go
extractJWK
func (wfe *WebFrontEndImpl) extractJWK(jws *jose.JSONWebSignature) (*jose.JSONWebKey, *probs.ProblemDetails) { // extractJWK expects the request to be using an embedded JWK auth type and // to not contain the mutually exclusive KeyID. if prob := wfe.enforceJWSAuthType(jws, embeddedJWK); prob != nil { return nil, p...
go
func (wfe *WebFrontEndImpl) extractJWK(jws *jose.JSONWebSignature) (*jose.JSONWebKey, *probs.ProblemDetails) { // extractJWK expects the request to be using an embedded JWK auth type and // to not contain the mutually exclusive KeyID. if prob := wfe.enforceJWSAuthType(jws, embeddedJWK); prob != nil { return nil, p...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "extractJWK", "(", "jws", "*", "jose", ".", "JSONWebSignature", ")", "(", "*", "jose", ".", "JSONWebKey", ",", "*", "probs", ".", "ProblemDetails", ")", "{", "// extractJWK expects the request to be using an embedde...
// extractJWK extracts a JWK from a provided JWS or returns a problem. It // expects that the JWS is using the embedded JWK style of authentication and // does not contain an embedded Key ID. Callers should have acquired the // provided JWS from parseJWS to ensure it has the correct number of signatures // present.
[ "extractJWK", "extracts", "a", "JWK", "from", "a", "provided", "JWS", "or", "returns", "a", "problem", ".", "It", "expects", "that", "the", "JWS", "is", "using", "the", "embedded", "JWK", "style", "of", "authentication", "and", "does", "not", "contain", "a...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L348-L369
31,082
letsencrypt/boulder
wfe2/verify.go
acctIDFromURL
func (wfe *WebFrontEndImpl) acctIDFromURL(acctURL string, request *http.Request) (int64, *probs.ProblemDetails) { // For normal ACME v2 accounts we expect the account URL has a prefix composed // of the Host header and the acctPath. expectedURLPrefix := web.RelativeEndpoint(request, acctPath) // Process the acctUR...
go
func (wfe *WebFrontEndImpl) acctIDFromURL(acctURL string, request *http.Request) (int64, *probs.ProblemDetails) { // For normal ACME v2 accounts we expect the account URL has a prefix composed // of the Host header and the acctPath. expectedURLPrefix := web.RelativeEndpoint(request, acctPath) // Process the acctUR...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "acctIDFromURL", "(", "acctURL", "string", ",", "request", "*", "http", ".", "Request", ")", "(", "int64", ",", "*", "probs", ".", "ProblemDetails", ")", "{", "// For normal ACME v2 accounts we expect the account UR...
// acctIDFromURL extracts the numeric int64 account ID from a ACMEv1 or ACMEv2 // account URL. If the acctURL has an invalid URL or the account ID in the // acctURL is non-numeric a MalformedProblem is returned.
[ "acctIDFromURL", "extracts", "the", "numeric", "int64", "account", "ID", "from", "a", "ACMEv1", "or", "ACMEv2", "account", "URL", ".", "If", "the", "acctURL", "has", "an", "invalid", "URL", "or", "the", "account", "ID", "in", "the", "acctURL", "is", "non",...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L374-L400
31,083
letsencrypt/boulder
wfe2/verify.go
lookupJWK
func (wfe *WebFrontEndImpl) lookupJWK( jws *jose.JSONWebSignature, ctx context.Context, request *http.Request, logEvent *web.RequestEvent) (*jose.JSONWebKey, *core.Registration, *probs.ProblemDetails) { // We expect the request to be using an embedded Key ID auth type and to not // contain the mutually exclusive ...
go
func (wfe *WebFrontEndImpl) lookupJWK( jws *jose.JSONWebSignature, ctx context.Context, request *http.Request, logEvent *web.RequestEvent) (*jose.JSONWebKey, *core.Registration, *probs.ProblemDetails) { // We expect the request to be using an embedded Key ID auth type and to not // contain the mutually exclusive ...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "lookupJWK", "(", "jws", "*", "jose", ".", "JSONWebSignature", ",", "ctx", "context", ".", "Context", ",", "request", "*", "http", ".", "Request", ",", "logEvent", "*", "web", ".", "RequestEvent", ")", "("...
// lookupJWK finds a JWK associated with the Key ID present in a provided JWS, // returning the JWK and a pointer to the associated account, or a problem. It // expects that the JWS is using the embedded Key ID style of authentication // and does not contain an embedded JWK. Callers should have acquired the // provided...
[ "lookupJWK", "finds", "a", "JWK", "associated", "with", "the", "Key", "ID", "present", "in", "a", "provided", "JWS", "returning", "the", "JWK", "and", "a", "pointer", "to", "the", "associated", "account", "or", "a", "problem", ".", "It", "expects", "that",...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L408-L456
31,084
letsencrypt/boulder
wfe2/verify.go
validPOSTForAccount
func (wfe *WebFrontEndImpl) validPOSTForAccount( request *http.Request, ctx context.Context, logEvent *web.RequestEvent) ([]byte, *jose.JSONWebSignature, *core.Registration, *probs.ProblemDetails) { // Parse the JWS from the POST request jws, prob := wfe.parseJWSRequest(request) if prob != nil { return nil, nil...
go
func (wfe *WebFrontEndImpl) validPOSTForAccount( request *http.Request, ctx context.Context, logEvent *web.RequestEvent) ([]byte, *jose.JSONWebSignature, *core.Registration, *probs.ProblemDetails) { // Parse the JWS from the POST request jws, prob := wfe.parseJWSRequest(request) if prob != nil { return nil, nil...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "validPOSTForAccount", "(", "request", "*", "http", ".", "Request", ",", "ctx", "context", ".", "Context", ",", "logEvent", "*", "web", ".", "RequestEvent", ")", "(", "[", "]", "byte", ",", "*", "jose", ...
// validPOSTForAccount checks that a given POST request has a valid JWS // using `validJWSForAccount`. If valid, the authenticated JWS body and the // registration that authenticated the body are returned. Otherwise a problem is // returned. The returned JWS body may be empty if the request is a POST-as-GET // request.
[ "validPOSTForAccount", "checks", "that", "a", "given", "POST", "request", "has", "a", "valid", "JWS", "using", "validJWSForAccount", ".", "If", "valid", "the", "authenticated", "JWS", "body", "and", "the", "registration", "that", "authenticated", "the", "body", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L546-L556
31,085
letsencrypt/boulder
wfe2/verify.go
validSelfAuthenticatedPOST
func (wfe *WebFrontEndImpl) validSelfAuthenticatedPOST( request *http.Request, logEvent *web.RequestEvent) ([]byte, *jose.JSONWebKey, *probs.ProblemDetails) { // Parse the JWS from the POST request jws, prob := wfe.parseJWSRequest(request) if prob != nil { return nil, nil, prob } // Extract and validate the em...
go
func (wfe *WebFrontEndImpl) validSelfAuthenticatedPOST( request *http.Request, logEvent *web.RequestEvent) ([]byte, *jose.JSONWebKey, *probs.ProblemDetails) { // Parse the JWS from the POST request jws, prob := wfe.parseJWSRequest(request) if prob != nil { return nil, nil, prob } // Extract and validate the em...
[ "func", "(", "wfe", "*", "WebFrontEndImpl", ")", "validSelfAuthenticatedPOST", "(", "request", "*", "http", ".", "Request", ",", "logEvent", "*", "web", ".", "RequestEvent", ")", "(", "[", "]", "byte", ",", "*", "jose", ".", "JSONWebKey", ",", "*", "prob...
// validSelfAuthenticatedPOST checks that a given POST request has a valid JWS // using `validSelfAuthenticatedJWS`.
[ "validSelfAuthenticatedPOST", "checks", "that", "a", "given", "POST", "request", "has", "a", "valid", "JWS", "using", "validSelfAuthenticatedJWS", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/verify.go#L619-L629
31,086
letsencrypt/boulder
bdns/dns.go
NewDNSClientImpl
func NewDNSClientImpl( readTimeout time.Duration, servers []string, stats metrics.Scope, clk clock.Clock, maxTries int, ) *DNSClientImpl { stats = stats.NewScope("DNS") // TODO(jmhodges): make constructor use an Option func pattern dnsClient := new(dns.Client) // Set timeout for underlying net.Conn dnsClient...
go
func NewDNSClientImpl( readTimeout time.Duration, servers []string, stats metrics.Scope, clk clock.Clock, maxTries int, ) *DNSClientImpl { stats = stats.NewScope("DNS") // TODO(jmhodges): make constructor use an Option func pattern dnsClient := new(dns.Client) // Set timeout for underlying net.Conn dnsClient...
[ "func", "NewDNSClientImpl", "(", "readTimeout", "time", ".", "Duration", ",", "servers", "[", "]", "string", ",", "stats", "metrics", ".", "Scope", ",", "clk", "clock", ".", "Clock", ",", "maxTries", "int", ",", ")", "*", "DNSClientImpl", "{", "stats", "...
// NewDNSClientImpl constructs a new DNS resolver object that utilizes the // provided list of DNS servers for resolution.
[ "NewDNSClientImpl", "constructs", "a", "new", "DNS", "resolver", "object", "that", "utilizes", "the", "provided", "list", "of", "DNS", "servers", "for", "resolution", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/bdns/dns.go#L175-L225
31,087
letsencrypt/boulder
bdns/dns.go
LookupTXT
func (dnsClient *DNSClientImpl) LookupTXT(ctx context.Context, hostname string) ([]string, []string, error) { var txt []string dnsType := dns.TypeTXT r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode != dns.RcodeSuccess { ...
go
func (dnsClient *DNSClientImpl) LookupTXT(ctx context.Context, hostname string) ([]string, []string, error) { var txt []string dnsType := dns.TypeTXT r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode != dns.RcodeSuccess { ...
[ "func", "(", "dnsClient", "*", "DNSClientImpl", ")", "LookupTXT", "(", "ctx", "context", ".", "Context", ",", "hostname", "string", ")", "(", "[", "]", "string", ",", "[", "]", "string", ",", "error", ")", "{", "var", "txt", "[", "]", "string", "\n",...
// LookupTXT sends a DNS query to find all TXT records associated with // the provided hostname which it returns along with the returned // DNS authority section.
[ "LookupTXT", "sends", "a", "DNS", "query", "to", "find", "all", "TXT", "records", "associated", "with", "the", "provided", "hostname", "which", "it", "returns", "along", "with", "the", "returned", "DNS", "authority", "section", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/bdns/dns.go#L360-L385
31,088
letsencrypt/boulder
bdns/dns.go
LookupCAA
func (dnsClient *DNSClientImpl) LookupCAA(ctx context.Context, hostname string) ([]*dns.CAA, error) { dnsType := dns.TypeCAA r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode == dns.RcodeServerFailure { return nil, &DNSError{...
go
func (dnsClient *DNSClientImpl) LookupCAA(ctx context.Context, hostname string) ([]*dns.CAA, error) { dnsType := dns.TypeCAA r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode == dns.RcodeServerFailure { return nil, &DNSError{...
[ "func", "(", "dnsClient", "*", "DNSClientImpl", ")", "LookupCAA", "(", "ctx", "context", ".", "Context", ",", "hostname", "string", ")", "(", "[", "]", "*", "dns", ".", "CAA", ",", "error", ")", "{", "dnsType", ":=", "dns", ".", "TypeCAA", "\n", "r",...
// LookupCAA sends a DNS query to find all CAA records associated with // the provided hostname.
[ "LookupCAA", "sends", "a", "DNS", "query", "to", "find", "all", "CAA", "records", "associated", "with", "the", "provided", "hostname", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/bdns/dns.go#L465-L483
31,089
letsencrypt/boulder
bdns/dns.go
LookupMX
func (dnsClient *DNSClientImpl) LookupMX(ctx context.Context, hostname string) ([]string, error) { dnsType := dns.TypeMX r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode != dns.RcodeSuccess { return nil, &DNSError{dnsType, ho...
go
func (dnsClient *DNSClientImpl) LookupMX(ctx context.Context, hostname string) ([]string, error) { dnsType := dns.TypeMX r, err := dnsClient.exchangeOne(ctx, hostname, dnsType) if err != nil { return nil, &DNSError{dnsType, hostname, err, -1} } if r.Rcode != dns.RcodeSuccess { return nil, &DNSError{dnsType, ho...
[ "func", "(", "dnsClient", "*", "DNSClientImpl", ")", "LookupMX", "(", "ctx", "context", ".", "Context", ",", "hostname", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "dnsType", ":=", "dns", ".", "TypeMX", "\n", "r", ",", "err", ":=...
// LookupMX sends a DNS query to find a MX record associated hostname and returns the // record target.
[ "LookupMX", "sends", "a", "DNS", "query", "to", "find", "a", "MX", "record", "associated", "hostname", "and", "returns", "the", "record", "target", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/bdns/dns.go#L487-L505
31,090
letsencrypt/boulder
cmd/gen-key/rsa.go
rsaArgs
func rsaArgs(label string, modulusLen, exponent uint, keyID []byte) generateArgs { // Encode as unpadded big endian encoded byte slice expSlice := big.NewInt(int64(exponent)).Bytes() log.Printf("\tEncoded public exponent (%d) as: %0X\n", exponent, expSlice) return generateArgs{ mechanism: []*pkcs11.Mechanism{ ...
go
func rsaArgs(label string, modulusLen, exponent uint, keyID []byte) generateArgs { // Encode as unpadded big endian encoded byte slice expSlice := big.NewInt(int64(exponent)).Bytes() log.Printf("\tEncoded public exponent (%d) as: %0X\n", exponent, expSlice) return generateArgs{ mechanism: []*pkcs11.Mechanism{ ...
[ "func", "rsaArgs", "(", "label", "string", ",", "modulusLen", ",", "exponent", "uint", ",", "keyID", "[", "]", "byte", ")", "generateArgs", "{", "// Encode as unpadded big endian encoded byte slice", "expSlice", ":=", "big", ".", "NewInt", "(", "int64", "(", "ex...
// rsaArgs constructs the private and public key template attributes sent to the // device and specifies which mechanism should be used. modulusLen specifies the // length of the modulus to be generated on the device in bits and exponent // specifies the public exponent that should be used.
[ "rsaArgs", "constructs", "the", "private", "and", "public", "key", "template", "attributes", "sent", "to", "the", "device", "and", "specifies", "which", "mechanism", "should", "be", "used", ".", "modulusLen", "specifies", "the", "length", "of", "the", "modulus",...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/rsa.go#L21-L52
31,091
letsencrypt/boulder
cmd/gen-key/rsa.go
rsaPub
func rsaPub(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, modulusLen, exponent uint) (*rsa.PublicKey, error) { pubKey, err := pkcs11helpers.GetRSAPublicKey(ctx, session, object) if err != nil { return nil, err } if pubKey.E != int(exponent) { return nil, errors.New("returned...
go
func rsaPub(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, modulusLen, exponent uint) (*rsa.PublicKey, error) { pubKey, err := pkcs11helpers.GetRSAPublicKey(ctx, session, object) if err != nil { return nil, err } if pubKey.E != int(exponent) { return nil, errors.New("returned...
[ "func", "rsaPub", "(", "ctx", "pkcs11helpers", ".", "PKCtx", ",", "session", "pkcs11", ".", "SessionHandle", ",", "object", "pkcs11", ".", "ObjectHandle", ",", "modulusLen", ",", "exponent", "uint", ")", "(", "*", "rsa", ".", "PublicKey", ",", "error", ")"...
// rsaPub extracts the generated public key, specified by the provided object // handle, and constructs a rsa.PublicKey. It also checks that the key has the // correct length modulus and that the public exponent is what was requested in // the public key template.
[ "rsaPub", "extracts", "the", "generated", "public", "key", "specified", "by", "the", "provided", "object", "handle", "and", "constructs", "a", "rsa", ".", "PublicKey", ".", "It", "also", "checks", "that", "the", "key", "has", "the", "correct", "length", "mod...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/rsa.go#L58-L72
31,092
letsencrypt/boulder
cmd/gen-key/rsa.go
rsaVerify
func rsaVerify(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, pub *rsa.PublicKey) error { nonce, err := getRandomBytes(ctx, session) if err != nil { return fmt.Errorf("Failed to retrieve nonce: %s", err) } log.Printf("\tConstructed nonce: %d (%X)\n", big.NewInt(0).SetBytes(nonc...
go
func rsaVerify(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, pub *rsa.PublicKey) error { nonce, err := getRandomBytes(ctx, session) if err != nil { return fmt.Errorf("Failed to retrieve nonce: %s", err) } log.Printf("\tConstructed nonce: %d (%X)\n", big.NewInt(0).SetBytes(nonc...
[ "func", "rsaVerify", "(", "ctx", "pkcs11helpers", ".", "PKCtx", ",", "session", "pkcs11", ".", "SessionHandle", ",", "object", "pkcs11", ".", "ObjectHandle", ",", "pub", "*", "rsa", ".", "PublicKey", ")", "error", "{", "nonce", ",", "err", ":=", "getRandom...
// rsaVerify verifies that the extracted public key corresponds with the generated // private key on the device, specified by the provided object handle, by signing // a nonce generated on the device and verifying the returned signature using the // public key.
[ "rsaVerify", "verifies", "that", "the", "extracted", "public", "key", "corresponds", "with", "the", "generated", "private", "key", "on", "the", "device", "specified", "by", "the", "provided", "object", "handle", "by", "signing", "a", "nonce", "generated", "on", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/rsa.go#L78-L97
31,093
letsencrypt/boulder
cmd/gen-key/rsa.go
rsaGenerate
func rsaGenerate(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label string, modulusLen, pubExponent uint) (*rsa.PublicKey, error) { keyID := make([]byte, 4) _, err := rand.Read(keyID) if err != nil { return nil, err } log.Printf("Generating RSA key with %d bit modulus and public exponent %d and ID %x\n...
go
func rsaGenerate(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label string, modulusLen, pubExponent uint) (*rsa.PublicKey, error) { keyID := make([]byte, 4) _, err := rand.Read(keyID) if err != nil { return nil, err } log.Printf("Generating RSA key with %d bit modulus and public exponent %d and ID %x\n...
[ "func", "rsaGenerate", "(", "ctx", "pkcs11helpers", ".", "PKCtx", ",", "session", "pkcs11", ".", "SessionHandle", ",", "label", "string", ",", "modulusLen", ",", "pubExponent", "uint", ")", "(", "*", "rsa", ".", "PublicKey", ",", "error", ")", "{", "keyID"...
// rsaGenerate is used to generate and verify a RSA key pair of the size // specified by modulusLen and with the exponent specified by pubExponent. // It returns the public part of the generated key pair as a rsa.PublicKey.
[ "rsaGenerate", "is", "used", "to", "generate", "and", "verify", "a", "RSA", "key", "pair", "of", "the", "size", "specified", "by", "modulusLen", "and", "with", "the", "exponent", "specified", "by", "pubExponent", ".", "It", "returns", "the", "public", "part"...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/rsa.go#L102-L127
31,094
letsencrypt/boulder
log/log.go
New
func New(log *syslog.Writer, stdoutLogLevel int, syslogLogLevel int) (Logger, error) { if log == nil { return nil, errors.New("Attempted to use a nil System Logger.") } return &impl{ &bothWriter{log, stdoutLogLevel, syslogLogLevel, clock.Default()}, }, nil }
go
func New(log *syslog.Writer, stdoutLogLevel int, syslogLogLevel int) (Logger, error) { if log == nil { return nil, errors.New("Attempted to use a nil System Logger.") } return &impl{ &bothWriter{log, stdoutLogLevel, syslogLogLevel, clock.Default()}, }, nil }
[ "func", "New", "(", "log", "*", "syslog", ".", "Writer", ",", "stdoutLogLevel", "int", ",", "syslogLogLevel", "int", ")", "(", "Logger", ",", "error", ")", "{", "if", "log", "==", "nil", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "...
// New returns a new Logger that uses the given syslog.Writer as a backend.
[ "New", "returns", "a", "new", "Logger", "that", "uses", "the", "given", "syslog", ".", "Writer", "as", "a", "backend", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L55-L62
31,095
letsencrypt/boulder
log/log.go
initialize
func initialize() { // defaultPriority is never used because we always use specific priority-based // logging methods. const defaultPriority = syslog.LOG_INFO | syslog.LOG_LOCAL0 syslogger, err := syslog.Dial("", "", defaultPriority, "test") if err != nil { panic(err) } logger, err := New(syslogger, int(syslog...
go
func initialize() { // defaultPriority is never used because we always use specific priority-based // logging methods. const defaultPriority = syslog.LOG_INFO | syslog.LOG_LOCAL0 syslogger, err := syslog.Dial("", "", defaultPriority, "test") if err != nil { panic(err) } logger, err := New(syslogger, int(syslog...
[ "func", "initialize", "(", ")", "{", "// defaultPriority is never used because we always use specific priority-based", "// logging methods.", "const", "defaultPriority", "=", "syslog", ".", "LOG_INFO", "|", "syslog", ".", "LOG_LOCAL0", "\n", "syslogger", ",", "err", ":=", ...
// initialize should only be used in unit tests.
[ "initialize", "should", "only", "be", "used", "in", "unit", "tests", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L65-L79
31,096
letsencrypt/boulder
log/log.go
Set
func Set(logger Logger) (err error) { if _Singleton.log != nil { err = errors.New("You may not call Set after it has already been implicitly or explicitly set.") _Singleton.log.Warning(err.Error()) } else { _Singleton.log = logger } return }
go
func Set(logger Logger) (err error) { if _Singleton.log != nil { err = errors.New("You may not call Set after it has already been implicitly or explicitly set.") _Singleton.log.Warning(err.Error()) } else { _Singleton.log = logger } return }
[ "func", "Set", "(", "logger", "Logger", ")", "(", "err", "error", ")", "{", "if", "_Singleton", ".", "log", "!=", "nil", "{", "err", "=", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "_Singleton", ".", "log", ".", "Warning", "(", "err", ".",...
// Set configures the singleton Logger. This method // must only be called once, and before calling Get the // first time.
[ "Set", "configures", "the", "singleton", "Logger", ".", "This", "method", "must", "only", "be", "called", "once", "and", "before", "calling", "Get", "the", "first", "time", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L84-L92
31,097
letsencrypt/boulder
log/log.go
Get
func Get() Logger { _Singleton.once.Do(func() { if _Singleton.log == nil { initialize() } }) return _Singleton.log }
go
func Get() Logger { _Singleton.once.Do(func() { if _Singleton.log == nil { initialize() } }) return _Singleton.log }
[ "func", "Get", "(", ")", "Logger", "{", "_Singleton", ".", "once", ".", "Do", "(", "func", "(", ")", "{", "if", "_Singleton", ".", "log", "==", "nil", "{", "initialize", "(", ")", "\n", "}", "\n", "}", ")", "\n\n", "return", "_Singleton", ".", "l...
// Get obtains the singleton Logger. If Set has not been called first, this // method initializes with basic defaults. The basic defaults cannot error, and // subsequent access to an already-set Logger also cannot error, so this method is // error-safe.
[ "Get", "obtains", "the", "singleton", "Logger", ".", "If", "Set", "has", "not", "been", "called", "first", "this", "method", "initializes", "with", "basic", "defaults", ".", "The", "basic", "defaults", "cannot", "error", "and", "subsequent", "access", "to", ...
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L98-L106
31,098
letsencrypt/boulder
log/log.go
logAtLevel
func (w *bothWriter) logAtLevel(level syslog.Priority, msg string) { var prefix string var err error const red = "\033[31m\033[1m" const yellow = "\033[33m" switch syslogAllowed := int(level) <= w.syslogLevel; level { case syslog.LOG_ERR: if syslogAllowed { err = w.Err(msg) } prefix = red + "E" case s...
go
func (w *bothWriter) logAtLevel(level syslog.Priority, msg string) { var prefix string var err error const red = "\033[31m\033[1m" const yellow = "\033[33m" switch syslogAllowed := int(level) <= w.syslogLevel; level { case syslog.LOG_ERR: if syslogAllowed { err = w.Err(msg) } prefix = red + "E" case s...
[ "func", "(", "w", "*", "bothWriter", ")", "logAtLevel", "(", "level", "syslog", ".", "Priority", ",", "msg", "string", ")", "{", "var", "prefix", "string", "\n", "var", "err", "error", "\n\n", "const", "red", "=", "\"", "\\033", "\\033", "\"", "\n", ...
// Log the provided message at the appropriate level, writing to // both stdout and the Logger
[ "Log", "the", "provided", "message", "at", "the", "appropriate", "level", "writing", "to", "both", "stdout", "and", "the", "Logger" ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L122-L171
31,099
letsencrypt/boulder
log/log.go
caller
func caller(level int) string { _, file, line, _ := runtime.Caller(level) splits := strings.Split(file, "/") filename := splits[len(splits)-1] return fmt.Sprintf("%s:%d:", filename, line) }
go
func caller(level int) string { _, file, line, _ := runtime.Caller(level) splits := strings.Split(file, "/") filename := splits[len(splits)-1] return fmt.Sprintf("%s:%d:", filename, line) }
[ "func", "caller", "(", "level", "int", ")", "string", "{", "_", ",", "file", ",", "line", ",", "_", ":=", "runtime", ".", "Caller", "(", "level", ")", "\n", "splits", ":=", "strings", ".", "Split", "(", "file", ",", "\"", "\"", ")", "\n", "filena...
// Return short format caller info for panic events, skipping to before the // panic handler.
[ "Return", "short", "format", "caller", "info", "for", "panic", "events", "skipping", "to", "before", "the", "panic", "handler", "." ]
a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf
https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L180-L185