Skip to content
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

Use dh-ietf1024-sha256-aes128-cbc-pkcs7 algorithm for secret service #83

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion secret_service/secret_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ss

import (
"fmt"
"strings"

"errors"

Expand Down Expand Up @@ -65,7 +66,14 @@ func (s *SecretService) OpenSession() (dbus.BusObject, error) {
var sessionPath dbus.ObjectPath
err := s.object.Call(serviceInterface+".OpenSession", 0, "plain", dbus.MakeVariant("")).Store(&disregard, &sessionPath)
if err != nil {
return nil, err
if strings.Contains(err.Error(), "Algorithm plain is not supported") {
err := s.object.Call(serviceInterface+".OpenSession", 0, "dh-ietf1024-sha256-aes128-cbc-pkcs7", dbus.MakeVariant("")).Store(&disregard, &sessionPath)
if err != nil {
return nil, err
}
} else {
return nil, err
}
}

return s.Object(serviceName, sessionPath), nil
Expand Down