mirror of
https://github.com/slackhq/nebula.git
synced 2026-02-15 17:24:23 +01:00
read the docs
This commit is contained in:
@@ -47,15 +47,8 @@ func NewCAPoolFromPEMReader(r io.Reader) (*CAPool, error) {
|
|||||||
scanner := bufio.NewScanner(r)
|
scanner := bufio.NewScanner(r)
|
||||||
scanner.Split(util.SplitPEM)
|
scanner.Split(util.SplitPEM)
|
||||||
|
|
||||||
for {
|
for scanner.Scan() {
|
||||||
ready := scanner.Scan()
|
|
||||||
if !ready {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
pemBytes := scanner.Bytes()
|
pemBytes := scanner.Bytes()
|
||||||
if scanner.Err() != nil {
|
|
||||||
return nil, scanner.Err()
|
|
||||||
}
|
|
||||||
|
|
||||||
block, rest := pem.Decode(pemBytes)
|
block, rest := pem.Decode(pemBytes)
|
||||||
if len(bytes.TrimSpace(rest)) > 0 {
|
if len(bytes.TrimSpace(rest)) > 0 {
|
||||||
@@ -78,6 +71,9 @@ func NewCAPoolFromPEMReader(r io.Reader) (*CAPool, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if err := scanner.Err(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if expired {
|
if expired {
|
||||||
return pool, ErrExpired
|
return pool, ErrExpired
|
||||||
|
|||||||
Reference in New Issue
Block a user