Fix flag count, remove session prefix from auth gdbm lookup
This commit is contained in:
parent
e410158432
commit
78fae3526b
@ -86,7 +86,7 @@ func main() {
|
|||||||
cfg := engine.Config{
|
cfg := engine.Config{
|
||||||
Root: "root",
|
Root: "root",
|
||||||
OutputSize: uint32(size),
|
OutputSize: uint32(size),
|
||||||
FlagCount: uint32(16),
|
FlagCount: uint32(128),
|
||||||
}
|
}
|
||||||
if stateDebug {
|
if stateDebug {
|
||||||
cfg.StateDebug = true
|
cfg.StateDebug = true
|
||||||
|
@ -44,6 +44,8 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
|
|||||||
return fmt.Errorf("Failed to parse public key: %v", err)
|
return fmt.Errorf("Failed to parse public key: %v", err)
|
||||||
}
|
}
|
||||||
k := append([]byte{0x01}, pubKey.Marshal()...)
|
k := append([]byte{0x01}, pubKey.Marshal()...)
|
||||||
|
s.store.SetLanguage(nil)
|
||||||
|
s.store.SetSession("")
|
||||||
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
||||||
logg.Infof("Added key", "sessionId", sessionId, "public key", string(publicBytes))
|
logg.Infof("Added key", "sessionId", sessionId, "public key", string(publicBytes))
|
||||||
return s.store.Put(ctx, k, []byte(sessionId))
|
return s.store.Put(ctx, k, []byte(sessionId))
|
||||||
@ -51,6 +53,7 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
|
|||||||
|
|
||||||
func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) {
|
func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) {
|
||||||
s.store.SetLanguage(nil)
|
s.store.SetLanguage(nil)
|
||||||
|
s.store.SetSession("")
|
||||||
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
||||||
k := append([]byte{0x01}, pubKey.Marshal()...)
|
k := append([]byte{0x01}, pubKey.Marshal()...)
|
||||||
v, err := s.store.Get(ctx, k)
|
v, err := s.store.Get(ctx, k)
|
||||||
|
Loading…
Reference in New Issue
Block a user