diff --git a/crypto/goolm/register.go b/crypto/goolm/register.go index 80ed206b..17e7f207 100644 --- a/crypto/goolm/register.go +++ b/crypto/goolm/register.go @@ -16,6 +16,8 @@ import ( ) func init() { + olm.Driver = "goolm" + olm.GetVersion = func() (major, minor, patch uint8) { return 3, 2, 15 } diff --git a/crypto/libolm/register.go b/crypto/libolm/register.go index 6aaec61e..06c07ea8 100644 --- a/crypto/libolm/register.go +++ b/crypto/libolm/register.go @@ -12,6 +12,8 @@ import ( var pickleKey = []byte("maunium.net/go/mautrix/crypto/olm") func init() { + olm.Driver = "libolm" + olm.GetVersion = func() (major, minor, patch uint8) { C.olm_get_library_version( (*C.uint8_t)(unsafe.Pointer(&major)), diff --git a/crypto/machine.go b/crypto/machine.go index 83ce024d..da3ebe67 100644 --- a/crypto/machine.go +++ b/crypto/machine.go @@ -19,6 +19,7 @@ import ( "go.mau.fi/util/exzerolog" "maunium.net/go/mautrix" + "maunium.net/go/mautrix/crypto/olm" "maunium.net/go/mautrix/crypto/ssss" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" @@ -159,6 +160,7 @@ func (mach *OlmMachine) Load(ctx context.Context) (err error) { zerolog.Ctx(ctx).Debug(). Str("machine_ptr", fmt.Sprintf("%p", mach)). Str("account_ptr", fmt.Sprintf("%p", mach.account.Internal)). + Str("olm_driver", olm.Driver). Msg("Loaded olm account") return nil } diff --git a/crypto/olm/account.go b/crypto/olm/account.go index 68393e8a..2ec5dd70 100644 --- a/crypto/olm/account.go +++ b/crypto/olm/account.go @@ -87,6 +87,8 @@ type Account interface { RemoveOneTimeKeys(s Session) error } +var Driver = "none" + var InitBlankAccount func() Account var InitNewAccount func() (Account, error) var InitNewAccountFromPickled func(pickled, key []byte) (Account, error)