-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with RetrieveSupportedCipherSuites #60
Comments
1 and 2 will need more work. 3 sounds fixable, but can I clarify: |
Does this example answer your question? I'm noticing today that I sometimes get other errors, too, when I fail to specify the CipherSuite - not only "none of the provided cipher suite options were supported by the BMC". $ go run ./... "${host}" "${ipmiuser}" "${ipmipw}"
2023/09/18 08:26:22 Connecting with CipherSuites=[]ipmi.CipherSuite{} ...
2023/09/18 08:26:22 new session: none of the provided cipher suite options were supported by the BMC
2023/09/18 08:26:22 Connecting with CipherSuites=[]ipmi.CipherSuite{ipmi.CipherSuite{AuthenticationAlgorithm:0x3, IntegrityAlgorithm:0x4, ConfidentialityAlgorithm:0x1}} ...
2023/09/18 08:26:22 Success.
$ go run ./... "${host}" "${ipmiuser}" "${ipmipw}"
2023/09/18 08:29:09 Connecting with CipherSuites=[]ipmi.CipherSuite{} ...
2023/09/18 08:29:09 new session: expected start of record, got 0x0
2023/09/18 08:29:09 Connecting with CipherSuites=[]ipmi.CipherSuite{ipmi.CipherSuite{AuthenticationAlgorithm:0x3, IntegrityAlgorithm:0x4, ConfidentialityAlgorithm:0x1}} ...
2023/09/18 08:29:09 Success. package main
import (
"context"
"log"
"os"
"time"
"github.com/gebn/bmc"
"github.com/gebn/bmc/pkg/ipmi"
)
func connect(transport *bmc.V2SessionlessTransport, user, pw string, cipherSuites []ipmi.CipherSuite) {
log.Printf("Connecting with CipherSuites=%#v ...", cipherSuites)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
session, err := transport.NewV2Session(ctx, &bmc.V2SessionOpts{
SessionOpts: bmc.SessionOpts{
Username: user,
Password: []byte(pw),
MaxPrivilegeLevel: ipmi.PrivilegeLevelUser,
},
CipherSuites: cipherSuites,
})
if err != nil {
log.Printf("new session: %v", err)
} else {
log.Printf("Success.")
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()
if err := session.Close(ctx); err != nil {
log.Printf("close session: %v", err)
}
}
}
func main() {
host := os.Args[1]
user := os.Args[2]
pw := os.Args[3]
transport, err := bmc.DialV2(host)
if err != nil {
log.Fatalf("dial: %v", err)
}
defer transport.Close()
connect(transport, user, pw, []ipmi.CipherSuite{})
connect(transport, user, pw, []ipmi.CipherSuite{ipmi.CipherSuite17})
} |
I'm very willing to believe that (1) and (2) are just badly-behaved BMCs. Happy to send a |
The If only one suite is passed when creating the session, we bypass For 3, can you provide a code sample - I'm still confused how |
I noticed today that I was failing to scrape a lot of nodes with errors like this:
When I switched from
NewSesssion
toNewV2Session
explicitly settingCipherSuites: []ipmi.CipherSuite{ipmi.CipherSuite17}
, things got much better! I can now scrape ~260 nodes intead of ~180 nodes.[17,3]
, soRetrieveSupportedCipherSuites
should have successfully determined that suite 17 was ok to use.RetrieveSupportedCipherSuites
once, it puts the BMC into a new state where your library can now runRetrieveSupportedCipherSuites
without errors. I don't understand that.RetrieveSupportedCipherSuites
, useful error messages such asRAKP2 HMAC fail (this indicates the BMC is using a different password)
are masked, and the library prints an error about unsupported cipher suites inteadThe text was updated successfully, but these errors were encountered: