Switching clients should not mean a new unique id. On every start the app now does what `voelinctl identity import --auto` does: identities in the official TeamSpeak 3/6 clients' databases that Voelin does not have yet are added, the files opened read-only and immutable as before. The identity the official client uses by default (field 5 of its payload, now read into `Found::selected`) goes in first, so when Voelin has no identity of its own yet, that one becomes Voelin's default and servers see the same unique id; an existing default stays. What was imported is shown once in the status line (the toast on desktop), by nickname. The runtime setting identity.import_from_teamspeak (default on) turns it off; the sample data of VOELIN_DEMO_UI never imports. The settings are now opened before the identity is chosen. Tested with synthetic databases only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 KiB
Identities
A TeamSpeak identity is an ECC P-256 key pair. The public key gives the client its unique id, which is how every server recognises it; the private key proves ownership. Losing it means losing every server group, every permission and every friend entry tied to that id — and anyone who copies it can impersonate its owner on every server. An identity file is a secret. Treat it like an SSH private key.
Voelin can import identities from the official clients so that switching does not mean starting over, and export them back so they are never trapped here.
The unique ids
Both generations derive the unique id from omega, the base64 of the DER
("tomcrypt") encoding of the public key:
| Server | Unique id |
|---|---|
| TeamSpeak 3 | base64(SHA1(omega)), 28 characters |
| TeamSpeak 6 | base64(SHA256(omega)), 44 characters |
The same key therefore has two ids. voelinctl identity show prints both
(uid and uid6); the store keys identities by the TeamSpeak 3 id, which is
the shorter and older of the two.
The security level is hash cash over omega: the number of trailing zero
bits of SHA1(omega || decimal counter), counted from the first byte. The
counter is stored next to the key; raising it raises the level, which is why
the counter travels with every export. Servers commonly require level 8.
The export string
Every format below ultimately holds the same string:
<counter>V<obfuscated base64>
<counter>is the hash cash counter in decimal.Vseparates it (the obfuscated part is base64, which never containsVbefore the firstVhere because the counter is digits only).- The obfuscated part is
base64(obfuscate(base64(DER key pair))), where the DER is tomcrypt'sSEQUENCE { BIT STRING, INTEGER 32, INTEGER x, INTEGER y, INTEGER private }(109–117 bytes in practice, so 152 base64 characters, so 204 characters after the second base64). obfuscateXORs the first 100 bytes with a fixed 128-byte table and the first 20 bytes withSHA1of the bytes from offset 20 up to the first zero byte. It is not encryption; it stops nothing. The algorithm lives intsproto_types::crypto::EccKeyPrivP256::{from,to}_ts_obfuscated.
tsproto's Identity::new_from_ts_str parses this string, so every importer
below only has to find it.
Where the clients keep it
TeamSpeak 3 and TeamSpeak 6: the ProtobufItems table
Both clients store identities in a table of the same shape, in their
settings.db (SQLite):
CREATE TABLE ProtobufItems (
timestamp integer unsigned NOT NULL,
key varchar NOT NULL UNIQUE,
value varchar -- protobuf bytes, despite the column type
)
key is "1", "2", … for the items plus one row "Checksum". Each item
value is a protobuf message with a common header and one payload field:
| Field | Wire type | Meaning |
|---|---|---|
| 2 | bytes | the item's own UUID (36 characters, with dashes) |
| 3 | bytes | a second UUID; present in TeamSpeak 6 rows, absent in TeamSpeak 3 rows |
| 4 | varint | small enum, 1 or 3 observed |
| 5 | bytes | optional UUID |
| 6 | varint | item type, 0–5 |
| 7, 8 | bytes | optional UUIDs, usually empty |
| 9 | varint | Unix timestamp in seconds |
| 16 + type | bytes | the payload, one field per item type |
The payload field number is 16 + type, so the type in field 6 says which
field carries the body. Type 1, payload field 17, is an identity:
| Field | Wire type | Meaning |
|---|---|---|
| 1 | bytes | the export string <counter>V<obfuscated base64> (207–213 characters) |
| 2 | bytes | the nickname, UTF-8 |
| 3 | bytes | an 8-character alphanumeric token, identical for every identity in one install — an account or device identifier, not part of the key |
| 4 | bytes | empty in every row seen |
| 5 | varint | 1 on exactly one identity: the selected one |
Voelin reads fields 1, 2 and 5 and ignores the rest. The other item types (0, 2, 3, 4, 5 — connection profiles, bookmarks, server lists and such) are not decoded; they are skipped by their type, not by guessing at their contents.
The Checksum row is SHA1 over the concatenation of the other rows' value
blobs in ascending numeric key order — 20 bytes, no key, no length prefixes.
It is an integrity check the client writes. Voelin does not verify it: it never
writes these files, so it cannot invalidate one, and refusing to import from a
database whose checksum a third-party tool left stale would help nobody. A key
that does not parse is rejected on its own merits.
AccountData/Account in the TeamSpeak 6 database is the myTeamSpeak account
record, not an identity — see research/myteamspeak.md.
It contains no ASN.1 key pair.
TeamSpeak 3: .ini export
"Export identity" in the TeamSpeak 3 client writes:
[Identity]
id=friendly name
identity="<counter>V<obfuscated base64>"
nickname=Nickname
The quotes around identity are optional in files seen in the wild, so both
forms are accepted. Keys are matched case-insensitively and the section header
is not required.
TeamSpeak 3: older Profiles rows
Client versions before the protobuf tables kept identities in the Profiles
table of settings.db as Identities/<n>/identity and
Identities/<n>/nickname rows. Voelin reads those too when they are present.
A current 3.6 install has only Capture/… and Playback/… rows there.
ts3clientui_qt.secrets.conf
Some TeamSpeak 3 builds keep the identity list in this Qt config file next to
settings.db. It is read by the same line scanner as the .ini export: every
identity= line becomes an identity and everything else is ignored. No such
file existed on the installation this was developed against, so that path is
best-effort — if a build wraps the lines in a container of its own, Voelin
finds nothing in it rather than guessing.
Default locations
Voelin looks in these places with --auto; each is opened read-only and none
is ever written.
| Client | Linux | Windows | macOS |
|---|---|---|---|
| TeamSpeak 3 | ~/.ts3client/settings.db |
%APPDATA%\TS3Client\settings.db |
~/Library/Application Support/TeamSpeak 3/settings.db |
| TeamSpeak 6 | ~/.config/TeamSpeak/Default/settings.db |
%APPDATA%\TeamSpeak\Default\settings.db |
~/Library/Application Support/TeamSpeak/Default/settings.db |
| TeamSpeak 6, Flatpak | ~/.var/app/com.teamspeak.TeamSpeak/config/TeamSpeak/Default/settings.db |
— | — |
| TeamSpeak 3, Flatpak | ~/.var/app/com.teamspeak.TeamSpeak3/.ts3client/settings.db |
— | — |
$XDG_CONFIG_HOME is honoured on Linux where the client honours it. Portable
installs keep settings.db next to the executable; point --from at it.
What Voelin does
voelin_core::identity reads and writes these forms; voelinctl drives it:
voelinctl identity import --auto [--dry-run] [--store <db>]
voelinctl identity import --from <path> [--dry-run] [--store <db>]
voelinctl identity list [--store <db>]
voelinctl identity export <id> <path> [--store <db>]
--store defaults to the desktop app's client database,
<data dir>/voelin/client.db, so the CLI and the app share identities.
On every start the app does the same as import --auto
(voelin_core::identity::import_new): identities found in the default
locations that the client database does not have yet are added, the files
are only read. The identity the official client uses by default (field 5 of
its payload, below) goes in first, so when Voelin has no identity of its own
yet, that one becomes Voelin's default (the first identity) and servers see
the same unique id; otherwise Voelin's default stays. What was imported is
shown once, in the status line (the toast on desktop), by nickname. The
runtime setting identity.import_from_teamspeak (default on) turns it off,
e.g. --set identity.import_from_teamspeak=false. The sample data of
VOELIN_DEMO_UI never imports.
- Import prints what it found as nickname, unique id and security level —
all three are public, everything else in an identity is the private key —
and stores each one through
voelin-storeunder its nickname. An identity whose TeamSpeak 3 unique id is already in the store is reported as a duplicate instead of being added twice, including repeats within one run.--dry-runreads and stores nothing. With--auto, a location that holds no identity is reported and skipped rather than ending the run. - Source files are opened read-only (
SQLITE_OPEN_READ_ONLY) andimmutable, so SQLite takes no lock, creates no-shmfile and does not replay a write-ahead log the running client left behind. Nothing of the user's is written, moved or copied. The cost is that an identity the client has written but not yet checkpointed into the main database file is not seen; closing the official client first makes sure everything is there. - Export writes the TeamSpeak 3
.iniform, which the official client and every other tool read. A new file is created with mode0600on Unix, before anything is written into it.
An import is only trusted when the key pair is whole: the public key derived
from the private scalar has to verify what that scalar signs. The tests check
this on synthetic identities, and on a real installation when
VOELIN_IDENTITY_IMPORT_CHECK points cargo test -p voelin-core at a
database — which is how this was verified without any client's data entering
the repository. Every fixture in the tests is generated by
tsclientlib::Identity::create.
Not supported
- Encrypted identity exports. The TeamSpeak 3 client can password-protect
an
.iniexport; that container is not decoded. Export without a password and import that. - The other
ProtobufItemsitem types. Bookmarks, connection profiles and server lists are not imported. Only identities are. - myTeamSpeak sign-in. There is no public API and the terms forbid the
non-public ones, so identities synchronised only to a myTeamSpeak account and
not present locally cannot be fetched. Sign in with the official client once
so it writes them to
settings.db, then import from there. - Writing back to the official clients. Voelin only reads them. Use the
.iniexport and the client's own import. - Bringing the nickname's history along. Only the key pair and the nickname are imported. Which servers an identity was used on, its badges and its myTeamSpeak links stay behind; servers re-associate by unique id on the next connection, which is the part that matters.