pkcs12: fix dropped error
This fixes a dropped error in Decode(). Change-Id: Iae5cac72f63a80dd5230034a3cfe1d6e76cc3415 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/205421 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Родитель
6e5058baad
Коммит
bd318be043
|
@ -252,6 +252,7 @@ func Decode(pfxData []byte, password string) (privateKey interface{}, certificat
|
||||||
case bag.Id.Equal(oidPKCS8ShroundedKeyBag):
|
case bag.Id.Equal(oidPKCS8ShroundedKeyBag):
|
||||||
if privateKey != nil {
|
if privateKey != nil {
|
||||||
err = errors.New("pkcs12: expected exactly one key bag")
|
err = errors.New("pkcs12: expected exactly one key bag")
|
||||||
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if privateKey, err = decodePkcs8ShroudedKeyBag(bag.Value.Bytes, encodedPassword); err != nil {
|
if privateKey, err = decodePkcs8ShroudedKeyBag(bag.Value.Bytes, encodedPassword); err != nil {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче