authority.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. package authority
  2. import (
  3. "context"
  4. "crypto"
  5. "crypto/sha256"
  6. "crypto/x509"
  7. "encoding/hex"
  8. "log"
  9. "strings"
  10. "sync"
  11. "time"
  12. "github.com/pkg/errors"
  13. "github.com/smallstep/certificates/authority/admin"
  14. adminDBNosql "github.com/smallstep/certificates/authority/admin/db/nosql"
  15. "github.com/smallstep/certificates/authority/administrator"
  16. "github.com/smallstep/certificates/authority/config"
  17. "github.com/smallstep/certificates/authority/provisioner"
  18. "github.com/smallstep/certificates/cas"
  19. casapi "github.com/smallstep/certificates/cas/apiv1"
  20. "github.com/smallstep/certificates/db"
  21. "github.com/smallstep/certificates/kms"
  22. kmsapi "github.com/smallstep/certificates/kms/apiv1"
  23. "github.com/smallstep/certificates/kms/sshagentkms"
  24. "github.com/smallstep/certificates/scep"
  25. "github.com/smallstep/certificates/templates"
  26. "github.com/smallstep/nosql"
  27. "go.step.sm/crypto/pemutil"
  28. "go.step.sm/linkedca"
  29. "golang.org/x/crypto/ssh"
  30. )
  31. // Authority implements the Certificate Authority internal interface.
  32. type Authority struct {
  33. config *config.Config
  34. keyManager kms.KeyManager
  35. provisioners *provisioner.Collection
  36. admins *administrator.Collection
  37. db db.AuthDB
  38. adminDB admin.DB
  39. templates *templates.Templates
  40. linkedCAToken string
  41. // X509 CA
  42. password []byte
  43. issuerPassword []byte
  44. x509CAService cas.CertificateAuthorityService
  45. rootX509Certs []*x509.Certificate
  46. rootX509CertPool *x509.CertPool
  47. federatedX509Certs []*x509.Certificate
  48. certificates *sync.Map
  49. x509Enforcers []provisioner.CertificateEnforcer
  50. // SCEP CA
  51. scepService *scep.Service
  52. // SSH CA
  53. sshHostPassword []byte
  54. sshUserPassword []byte
  55. sshCAUserCertSignKey ssh.Signer
  56. sshCAHostCertSignKey ssh.Signer
  57. sshCAUserCerts []ssh.PublicKey
  58. sshCAHostCerts []ssh.PublicKey
  59. sshCAUserFederatedCerts []ssh.PublicKey
  60. sshCAHostFederatedCerts []ssh.PublicKey
  61. // Do not re-initialize
  62. initOnce bool
  63. startTime time.Time
  64. // Custom functions
  65. sshBastionFunc func(ctx context.Context, user, hostname string) (*config.Bastion, error)
  66. sshCheckHostFunc func(ctx context.Context, principal string, tok string, roots []*x509.Certificate) (bool, error)
  67. sshGetHostsFunc func(ctx context.Context, cert *x509.Certificate) ([]config.Host, error)
  68. getIdentityFunc provisioner.GetIdentityFunc
  69. authorizeRenewFunc provisioner.AuthorizeRenewFunc
  70. authorizeSSHRenewFunc provisioner.AuthorizeSSHRenewFunc
  71. adminMutex sync.RWMutex
  72. }
  73. // New creates and initiates a new Authority type.
  74. func New(cfg *config.Config, opts ...Option) (*Authority, error) {
  75. err := cfg.Validate()
  76. if err != nil {
  77. return nil, err
  78. }
  79. var a = &Authority{
  80. config: cfg,
  81. certificates: new(sync.Map),
  82. }
  83. // Apply options.
  84. for _, fn := range opts {
  85. if err := fn(a); err != nil {
  86. return nil, err
  87. }
  88. }
  89. // Initialize authority from options or configuration.
  90. if err := a.init(); err != nil {
  91. return nil, err
  92. }
  93. return a, nil
  94. }
  95. // NewEmbedded initializes an authority that can be embedded in a different
  96. // project without the limitations of the config.
  97. func NewEmbedded(opts ...Option) (*Authority, error) {
  98. a := &Authority{
  99. config: &config.Config{},
  100. certificates: new(sync.Map),
  101. }
  102. // Apply options.
  103. for _, fn := range opts {
  104. if err := fn(a); err != nil {
  105. return nil, err
  106. }
  107. }
  108. // Validate required options
  109. switch {
  110. case a.config == nil:
  111. return nil, errors.New("cannot create an authority without a configuration")
  112. case len(a.rootX509Certs) == 0 && a.config.Root.HasEmpties():
  113. return nil, errors.New("cannot create an authority without a root certificate")
  114. case a.x509CAService == nil && a.config.IntermediateCert == "":
  115. return nil, errors.New("cannot create an authority without an issuer certificate")
  116. case a.x509CAService == nil && a.config.IntermediateKey == "":
  117. return nil, errors.New("cannot create an authority without an issuer signer")
  118. }
  119. // Initialize config required fields.
  120. a.config.Init()
  121. // Initialize authority from options or configuration.
  122. if err := a.init(); err != nil {
  123. return nil, err
  124. }
  125. return a, nil
  126. }
  127. // reloadAdminResources reloads admins and provisioners from the DB.
  128. func (a *Authority) reloadAdminResources(ctx context.Context) error {
  129. var (
  130. provList provisioner.List
  131. adminList []*linkedca.Admin
  132. )
  133. if a.config.AuthorityConfig.EnableAdmin {
  134. provs, err := a.adminDB.GetProvisioners(ctx)
  135. if err != nil {
  136. return admin.WrapErrorISE(err, "error getting provisioners to initialize authority")
  137. }
  138. provList, err = provisionerListToCertificates(provs)
  139. if err != nil {
  140. return admin.WrapErrorISE(err, "error converting provisioner list to certificates")
  141. }
  142. adminList, err = a.adminDB.GetAdmins(ctx)
  143. if err != nil {
  144. return admin.WrapErrorISE(err, "error getting admins to initialize authority")
  145. }
  146. } else {
  147. provList = a.config.AuthorityConfig.Provisioners
  148. adminList = a.config.AuthorityConfig.Admins
  149. }
  150. provisionerConfig, err := a.generateProvisionerConfig(ctx)
  151. if err != nil {
  152. return admin.WrapErrorISE(err, "error generating provisioner config")
  153. }
  154. // Create provisioner collection.
  155. provClxn := provisioner.NewCollection(provisionerConfig.Audiences)
  156. for _, p := range provList {
  157. if err := p.Init(provisionerConfig); err != nil {
  158. return err
  159. }
  160. if err := provClxn.Store(p); err != nil {
  161. return err
  162. }
  163. }
  164. // Create admin collection.
  165. adminClxn := administrator.NewCollection(provClxn)
  166. for _, adm := range adminList {
  167. p, ok := provClxn.Load(adm.ProvisionerId)
  168. if !ok {
  169. return admin.NewErrorISE("provisioner %s not found when loading admin %s",
  170. adm.ProvisionerId, adm.Id)
  171. }
  172. if err := adminClxn.Store(adm, p); err != nil {
  173. return err
  174. }
  175. }
  176. a.config.AuthorityConfig.Provisioners = provList
  177. a.provisioners = provClxn
  178. a.config.AuthorityConfig.Admins = adminList
  179. a.admins = adminClxn
  180. return nil
  181. }
  182. // init performs validation and initializes the fields of an Authority struct.
  183. func (a *Authority) init() error {
  184. // Check if handler has already been validated/initialized.
  185. if a.initOnce {
  186. return nil
  187. }
  188. var err error
  189. // Set password if they are not set.
  190. var configPassword []byte
  191. if a.config.Password != "" {
  192. configPassword = []byte(a.config.Password)
  193. }
  194. if configPassword != nil && a.password == nil {
  195. a.password = configPassword
  196. }
  197. if a.sshHostPassword == nil {
  198. a.sshHostPassword = a.password
  199. }
  200. if a.sshUserPassword == nil {
  201. a.sshUserPassword = a.password
  202. }
  203. // Automatically enable admin for all linked cas.
  204. if a.linkedCAToken != "" {
  205. a.config.AuthorityConfig.EnableAdmin = true
  206. }
  207. // Initialize step-ca Database if it's not already initialized with WithDB.
  208. // If a.config.DB is nil then a simple, barebones in memory DB will be used.
  209. if a.db == nil {
  210. if a.db, err = db.New(a.config.DB); err != nil {
  211. return err
  212. }
  213. }
  214. // Initialize key manager if it has not been set in the options.
  215. if a.keyManager == nil {
  216. var options kmsapi.Options
  217. if a.config.KMS != nil {
  218. options = *a.config.KMS
  219. }
  220. a.keyManager, err = kms.New(context.Background(), options)
  221. if err != nil {
  222. return err
  223. }
  224. }
  225. // Initialize the X.509 CA Service if it has not been set in the options.
  226. if a.x509CAService == nil {
  227. var options casapi.Options
  228. if a.config.AuthorityConfig.Options != nil {
  229. options = *a.config.AuthorityConfig.Options
  230. }
  231. // Set the issuer password if passed in the flags.
  232. if options.CertificateIssuer != nil && a.issuerPassword != nil {
  233. options.CertificateIssuer.Password = string(a.issuerPassword)
  234. }
  235. // Read intermediate and create X509 signer for default CAS.
  236. if options.Is(casapi.SoftCAS) {
  237. options.CertificateChain, err = pemutil.ReadCertificateBundle(a.config.IntermediateCert)
  238. if err != nil {
  239. return err
  240. }
  241. options.Signer, err = a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
  242. SigningKey: a.config.IntermediateKey,
  243. Password: []byte(a.password),
  244. })
  245. if err != nil {
  246. return err
  247. }
  248. }
  249. a.x509CAService, err = cas.New(context.Background(), options)
  250. if err != nil {
  251. return err
  252. }
  253. // Get root certificate from CAS.
  254. if srv, ok := a.x509CAService.(casapi.CertificateAuthorityGetter); ok {
  255. resp, err := srv.GetCertificateAuthority(&casapi.GetCertificateAuthorityRequest{
  256. Name: options.CertificateAuthority,
  257. })
  258. if err != nil {
  259. return err
  260. }
  261. a.rootX509Certs = append(a.rootX509Certs, resp.RootCertificate)
  262. sum := sha256.Sum256(resp.RootCertificate.Raw)
  263. log.Printf("Using root fingerprint '%s'", hex.EncodeToString(sum[:]))
  264. }
  265. }
  266. // Read root certificates and store them in the certificates map.
  267. if len(a.rootX509Certs) == 0 {
  268. a.rootX509Certs = make([]*x509.Certificate, len(a.config.Root))
  269. for i, path := range a.config.Root {
  270. crt, err := pemutil.ReadCertificate(path)
  271. if err != nil {
  272. return err
  273. }
  274. a.rootX509Certs[i] = crt
  275. }
  276. }
  277. for _, crt := range a.rootX509Certs {
  278. sum := sha256.Sum256(crt.Raw)
  279. a.certificates.Store(hex.EncodeToString(sum[:]), crt)
  280. }
  281. a.rootX509CertPool = x509.NewCertPool()
  282. for _, cert := range a.rootX509Certs {
  283. a.rootX509CertPool.AddCert(cert)
  284. }
  285. // Read federated certificates and store them in the certificates map.
  286. if len(a.federatedX509Certs) == 0 {
  287. a.federatedX509Certs = make([]*x509.Certificate, len(a.config.FederatedRoots))
  288. for i, path := range a.config.FederatedRoots {
  289. crt, err := pemutil.ReadCertificate(path)
  290. if err != nil {
  291. return err
  292. }
  293. a.federatedX509Certs[i] = crt
  294. }
  295. }
  296. for _, crt := range a.federatedX509Certs {
  297. sum := sha256.Sum256(crt.Raw)
  298. a.certificates.Store(hex.EncodeToString(sum[:]), crt)
  299. }
  300. // Decrypt and load SSH keys
  301. var tmplVars templates.Step
  302. if a.config.SSH != nil {
  303. if a.config.SSH.HostKey != "" {
  304. signer, err := a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
  305. SigningKey: a.config.SSH.HostKey,
  306. Password: []byte(a.sshHostPassword),
  307. })
  308. if err != nil {
  309. return err
  310. }
  311. // If our signer is from sshagentkms, just unwrap it instead of
  312. // wrapping it in another layer, and this prevents crypto from
  313. // erroring out with: ssh: unsupported key type *agent.Key
  314. switch s := signer.(type) {
  315. case *sshagentkms.WrappedSSHSigner:
  316. a.sshCAHostCertSignKey = s.Sshsigner
  317. case crypto.Signer:
  318. a.sshCAHostCertSignKey, err = ssh.NewSignerFromSigner(s)
  319. default:
  320. return errors.Errorf("unsupported signer type %T", signer)
  321. }
  322. if err != nil {
  323. return errors.Wrap(err, "error creating ssh signer")
  324. }
  325. // Append public key to list of host certs
  326. a.sshCAHostCerts = append(a.sshCAHostCerts, a.sshCAHostCertSignKey.PublicKey())
  327. a.sshCAHostFederatedCerts = append(a.sshCAHostFederatedCerts, a.sshCAHostCertSignKey.PublicKey())
  328. }
  329. if a.config.SSH.UserKey != "" {
  330. signer, err := a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
  331. SigningKey: a.config.SSH.UserKey,
  332. Password: []byte(a.sshUserPassword),
  333. })
  334. if err != nil {
  335. return err
  336. }
  337. // If our signer is from sshagentkms, just unwrap it instead of
  338. // wrapping it in another layer, and this prevents crypto from
  339. // erroring out with: ssh: unsupported key type *agent.Key
  340. switch s := signer.(type) {
  341. case *sshagentkms.WrappedSSHSigner:
  342. a.sshCAUserCertSignKey = s.Sshsigner
  343. case crypto.Signer:
  344. a.sshCAUserCertSignKey, err = ssh.NewSignerFromSigner(s)
  345. default:
  346. return errors.Errorf("unsupported signer type %T", signer)
  347. }
  348. if err != nil {
  349. return errors.Wrap(err, "error creating ssh signer")
  350. }
  351. // Append public key to list of user certs
  352. a.sshCAUserCerts = append(a.sshCAUserCerts, a.sshCAUserCertSignKey.PublicKey())
  353. a.sshCAUserFederatedCerts = append(a.sshCAUserFederatedCerts, a.sshCAUserCertSignKey.PublicKey())
  354. }
  355. // Append other public keys and add them to the template variables.
  356. for _, key := range a.config.SSH.Keys {
  357. publicKey := key.PublicKey()
  358. switch key.Type {
  359. case provisioner.SSHHostCert:
  360. if key.Federated {
  361. a.sshCAHostFederatedCerts = append(a.sshCAHostFederatedCerts, publicKey)
  362. } else {
  363. a.sshCAHostCerts = append(a.sshCAHostCerts, publicKey)
  364. }
  365. case provisioner.SSHUserCert:
  366. if key.Federated {
  367. a.sshCAUserFederatedCerts = append(a.sshCAUserFederatedCerts, publicKey)
  368. } else {
  369. a.sshCAUserCerts = append(a.sshCAUserCerts, publicKey)
  370. }
  371. default:
  372. return errors.Errorf("unsupported type %s", key.Type)
  373. }
  374. }
  375. }
  376. // Configure template variables. On the template variables HostFederatedKeys
  377. // and UserFederatedKeys we will skip the actual CA that will be available
  378. // in HostKey and UserKey.
  379. //
  380. // We cannot do it in the previous blocks because this configuration can be
  381. // injected using options.
  382. if a.sshCAHostCertSignKey != nil {
  383. tmplVars.SSH.HostKey = a.sshCAHostCertSignKey.PublicKey()
  384. tmplVars.SSH.HostFederatedKeys = append(tmplVars.SSH.HostFederatedKeys, a.sshCAHostFederatedCerts[1:]...)
  385. } else {
  386. tmplVars.SSH.HostFederatedKeys = append(tmplVars.SSH.HostFederatedKeys, a.sshCAHostFederatedCerts...)
  387. }
  388. if a.sshCAUserCertSignKey != nil {
  389. tmplVars.SSH.UserKey = a.sshCAUserCertSignKey.PublicKey()
  390. tmplVars.SSH.UserFederatedKeys = append(tmplVars.SSH.UserFederatedKeys, a.sshCAUserFederatedCerts[1:]...)
  391. } else {
  392. tmplVars.SSH.UserFederatedKeys = append(tmplVars.SSH.UserFederatedKeys, a.sshCAUserFederatedCerts...)
  393. }
  394. // Check if a KMS with decryption capability is required and available
  395. if a.requiresDecrypter() {
  396. if _, ok := a.keyManager.(kmsapi.Decrypter); !ok {
  397. return errors.New("keymanager doesn't provide crypto.Decrypter")
  398. }
  399. }
  400. // TODO: decide if this is a good approach for providing the SCEP functionality
  401. // It currently mirrors the logic for the x509CAService
  402. if a.requiresSCEPService() && a.scepService == nil {
  403. var options scep.Options
  404. // Read intermediate and create X509 signer and decrypter for default CAS.
  405. options.CertificateChain, err = pemutil.ReadCertificateBundle(a.config.IntermediateCert)
  406. if err != nil {
  407. return err
  408. }
  409. options.CertificateChain = append(options.CertificateChain, a.rootX509Certs...)
  410. options.Signer, err = a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
  411. SigningKey: a.config.IntermediateKey,
  412. Password: []byte(a.password),
  413. })
  414. if err != nil {
  415. return err
  416. }
  417. if km, ok := a.keyManager.(kmsapi.Decrypter); ok {
  418. options.Decrypter, err = km.CreateDecrypter(&kmsapi.CreateDecrypterRequest{
  419. DecryptionKey: a.config.IntermediateKey,
  420. Password: []byte(a.password),
  421. })
  422. if err != nil {
  423. return err
  424. }
  425. }
  426. a.scepService, err = scep.NewService(context.Background(), options)
  427. if err != nil {
  428. return err
  429. }
  430. // TODO: mimick the x509CAService GetCertificateAuthority here too?
  431. }
  432. if a.config.AuthorityConfig.EnableAdmin {
  433. // Initialize step-ca Admin Database if it's not already initialized using
  434. // WithAdminDB.
  435. if a.adminDB == nil {
  436. if a.linkedCAToken == "" {
  437. // Check if AuthConfig already exists
  438. a.adminDB, err = adminDBNosql.New(a.db.(nosql.DB), admin.DefaultAuthorityID)
  439. if err != nil {
  440. return err
  441. }
  442. } else {
  443. // Use the linkedca client as the admindb.
  444. client, err := newLinkedCAClient(a.linkedCAToken)
  445. if err != nil {
  446. return err
  447. }
  448. // If authorityId is configured make sure it matches the one in the token
  449. if id := a.config.AuthorityConfig.AuthorityID; id != "" && !strings.EqualFold(id, client.authorityID) {
  450. return errors.New("error initializing linkedca: token authority and configured authority do not match")
  451. }
  452. client.Run()
  453. a.adminDB = client
  454. }
  455. }
  456. provs, err := a.adminDB.GetProvisioners(context.Background())
  457. if err != nil {
  458. return admin.WrapErrorISE(err, "error loading provisioners to initialize authority")
  459. }
  460. if len(provs) == 0 && !strings.EqualFold(a.config.AuthorityConfig.DeploymentType, "linked") {
  461. // Create First Provisioner
  462. prov, err := CreateFirstProvisioner(context.Background(), a.adminDB, string(a.password))
  463. if err != nil {
  464. return admin.WrapErrorISE(err, "error creating first provisioner")
  465. }
  466. // Create first admin
  467. if err := a.adminDB.CreateAdmin(context.Background(), &linkedca.Admin{
  468. ProvisionerId: prov.Id,
  469. Subject: "step",
  470. Type: linkedca.Admin_SUPER_ADMIN,
  471. }); err != nil {
  472. return admin.WrapErrorISE(err, "error creating first admin")
  473. }
  474. }
  475. }
  476. // Load Provisioners and Admins
  477. if err := a.reloadAdminResources(context.Background()); err != nil {
  478. return err
  479. }
  480. // Configure templates, currently only ssh templates are supported.
  481. if a.sshCAHostCertSignKey != nil || a.sshCAUserCertSignKey != nil {
  482. a.templates = a.config.Templates
  483. if a.templates == nil {
  484. a.templates = templates.DefaultTemplates()
  485. }
  486. if a.templates.Data == nil {
  487. a.templates.Data = make(map[string]interface{})
  488. }
  489. a.templates.Data["Step"] = tmplVars
  490. }
  491. // JWT numeric dates are seconds.
  492. a.startTime = time.Now().Truncate(time.Second)
  493. // Set flag indicating that initialization has been completed, and should
  494. // not be repeated.
  495. a.initOnce = true
  496. return nil
  497. }
  498. // GetDatabase returns the authority database. If the configuration does not
  499. // define a database, GetDatabase will return a db.SimpleDB instance.
  500. func (a *Authority) GetDatabase() db.AuthDB {
  501. return a.db
  502. }
  503. // GetAdminDatabase returns the admin database, if one exists.
  504. func (a *Authority) GetAdminDatabase() admin.DB {
  505. return a.adminDB
  506. }
  507. // IsAdminAPIEnabled returns a boolean indicating whether the Admin API has
  508. // been enabled.
  509. func (a *Authority) IsAdminAPIEnabled() bool {
  510. return a.config.AuthorityConfig.EnableAdmin
  511. }
  512. // Shutdown safely shuts down any clients, databases, etc. held by the Authority.
  513. func (a *Authority) Shutdown() error {
  514. if err := a.keyManager.Close(); err != nil {
  515. log.Printf("error closing the key manager: %v", err)
  516. }
  517. return a.db.Shutdown()
  518. }
  519. // CloseForReload closes internal services, to allow a safe reload.
  520. func (a *Authority) CloseForReload() {
  521. if err := a.keyManager.Close(); err != nil {
  522. log.Printf("error closing the key manager: %v", err)
  523. }
  524. if client, ok := a.adminDB.(*linkedCaClient); ok {
  525. client.Stop()
  526. }
  527. }
  528. // IsRevoked returns whether or not a certificate has been
  529. // revoked before.
  530. func (a *Authority) IsRevoked(sn string) (bool, error) {
  531. // Check the passive revocation table.
  532. if lca, ok := a.adminDB.(interface {
  533. IsRevoked(string) (bool, error)
  534. }); ok {
  535. return lca.IsRevoked(sn)
  536. }
  537. return a.db.IsRevoked(sn)
  538. }
  539. // requiresDecrypter returns whether the Authority
  540. // requires a KMS that provides a crypto.Decrypter
  541. // Currently this is only required when SCEP is
  542. // enabled.
  543. func (a *Authority) requiresDecrypter() bool {
  544. return a.requiresSCEPService()
  545. }
  546. // requiresSCEPService iterates over the configured provisioners
  547. // and determines if one of them is a SCEP provisioner.
  548. func (a *Authority) requiresSCEPService() bool {
  549. for _, p := range a.config.AuthorityConfig.Provisioners {
  550. if p.GetType() == provisioner.TypeSCEP {
  551. return true
  552. }
  553. }
  554. return false
  555. }
  556. // GetSCEPService returns the configured SCEP Service
  557. // TODO: this function is intended to exist temporarily
  558. // in order to make SCEP work more easily. It can be
  559. // made more correct by using the right interfaces/abstractions
  560. // after it works as expected.
  561. func (a *Authority) GetSCEPService() *scep.Service {
  562. return a.scepService
  563. }