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:
Lars Lehtonen 2019-11-05 07:52:03 -08:00 коммит произвёл Brad Fitzpatrick
Родитель 6e5058baad
Коммит bd318be043
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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 {