mirror of
https://github.com/slackhq/nebula.git
synced 2026-01-20 19:42:10 -08:00
read the docs
This commit is contained in:
parent
6c9fa3f342
commit
886141decf
1 changed files with 4 additions and 8 deletions
|
|
@ -47,15 +47,8 @@ func NewCAPoolFromPEMReader(r io.Reader) (*CAPool, error) {
|
|||
scanner := bufio.NewScanner(r)
|
||||
scanner.Split(util.SplitPEM)
|
||||
|
||||
for {
|
||||
ready := scanner.Scan()
|
||||
if !ready {
|
||||
break
|
||||
}
|
||||
for scanner.Scan() {
|
||||
pemBytes := scanner.Bytes()
|
||||
if scanner.Err() != nil {
|
||||
return nil, scanner.Err()
|
||||
}
|
||||
|
||||
block, rest := pem.Decode(pemBytes)
|
||||
if len(bytes.TrimSpace(rest)) > 0 {
|
||||
|
|
@ -78,6 +71,9 @@ func NewCAPoolFromPEMReader(r io.Reader) (*CAPool, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
if err := scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if expired {
|
||||
return pool, ErrExpired
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue