(password string, seed []byte, pub *rsa.PublicKey)
| 218 | } |
| 219 | |
| 220 | func encryptPassword(password string, seed []byte, pub *rsa.PublicKey) ([]byte, error) { |
| 221 | plain := make([]byte, len(password)+1) |
| 222 | copy(plain, password) |
| 223 | for i := range plain { |
| 224 | j := i % len(seed) |
| 225 | plain[i] ^= seed[j] |
| 226 | } |
| 227 | sha1 := sha1.New() |
| 228 | return rsa.EncryptOAEP(sha1, rand.Reader, pub, plain, nil) |
| 229 | } |
| 230 | |
| 231 | // authEd25519 does ed25519 authentication used by MariaDB. |
| 232 | func authEd25519(scramble []byte, password string) ([]byte, error) { |
no outgoing calls
no test coverage detected