Skip to content

PBS-33: support caching_sha2_password RSA full auth in minimysql - #160

Open
kamil-holubicki wants to merge 2 commits into
Percona-Lab:mainfrom
kamil-holubicki:PBS-33
Open

PBS-33: support caching_sha2_password RSA full auth in minimysql#160
kamil-holubicki wants to merge 2 commits into
Percona-Lab:mainfrom
kamil-holubicki:PBS-33

Conversation

@kamil-holubicki

Copy link
Copy Markdown
Collaborator

https://perconadev.atlassian.net/browse/PBS-33

Added:
Encapsulate caching_sha2_password in caching_sha2_password_authenticator
(scramble verify, AuthSwitch data, 0x03/0x04, PEM, RSA decrypt,
cleartext stub for future TLS).

Auth loop in network_service stays auth-method agnostic: optional
AuthSwitch on plugin mismatch, then
begin_authentication / outbound frames / client frames until done.

Fast auth when the handshake scramble matches the configured password;
otherwise full auth (0x04) with RSA on plain TCP (0x02 + PEM or
ciphertext via --server-public-key-path).

Wire AuthMoreData (0x01 || plugin data) for 0x03, 0x04, and PEM,
matching Percona Server/MySql mpvio wrapping.

Thread server_rsa_public/private_key_path from minimysql_app through
network_service -> connection_context -> authenticator (empty = embedded
defaults; one-sided config fails hard).

Random 20-byte greeting salt; unit tests for fast path, RSA path, and
key path validation.

How this differs from Percona Server/MySql:
No SHA2 digest cache: every successful scramble is treated as a cache
hit, including the first connection. PS does full auth
(RSA on plain TCP / cleartext on SSL) on cache miss, then caches for
later fast auth.

No TLS yet: connection_is_secure() is always false; cleartext-after-0x04
is stubbed only. PS accepts cleartext password over SSL/socket after
0x04.

Single configured user/password and optional key paths (or embedded MTR
keys), not ACL / auto-generated server RSA keys from config.

https://perconadev.atlassian.net/browse/PBS-32

Implement AuthSwitchRequest handling when the client replies with an
authentication plugin that differs from the server account plugin. The
server now sends the switch request, reads the client auth switch
response, updates the connection context, and continues normal
authentication.

Format the auth switch plugin data through a helper so
caching_sha2_password keeps the historical trailing NULL filler expected
by MySQL clients, while leaving future plugins free to define their own
payload shape.
https://perconadev.atlassian.net/browse/PBS-33

Added:
Encapsulate caching_sha2_password in caching_sha2_password_authenticator
(scramble verify, AuthSwitch data, 0x03/0x04, PEM, RSA decrypt,
cleartext stub for future TLS).

Auth loop in network_service stays auth-method agnostic: optional
AuthSwitch on plugin mismatch, then
begin_authentication / outbound frames / client frames until done.

Fast auth when the handshake scramble matches the configured password;
otherwise full auth (0x04) with RSA on plain TCP (0x02 + PEM or
ciphertext via --server-public-key-path).

Wire AuthMoreData (0x01 || plugin data) for 0x03, 0x04, and PEM,
matching Percona Server/MySql mpvio wrapping.

Thread server_rsa_public/private_key_path from minimysql_app through
network_service -> connection_context -> authenticator (empty = embedded
defaults; one-sided config fails hard).

Random 20-byte greeting salt; unit tests for fast path, RSA path, and
key path validation.

How this differs from Percona Server/MySql:
No SHA2 digest cache: every successful scramble is treated as a cache
hit, including the first connection. PS does full auth
(RSA on plain TCP / cleartext on SSL) on cache miss, then caches for
later fast auth.

No TLS yet: connection_is_secure() is always false; cleartext-after-0x04
is stubbed only. PS accepts cleartext password over SSL/socket after
0x04.

Single configured user/password and optional key paths (or embedded MTR
keys), not ACL / auto-generated server RSA keys from config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant