| 680 | | void _verify_user(SmlAuthenticator *auth, const char *username, const char *password, void *userdata, SmlErrorType *reply) |
|---|
| 681 | | { |
|---|
| 682 | | osync_trace(TRACE_ENTRY, "%s(%p, %s, %s, %p, %p)", __func__, auth, username, password, userdata, reply); |
|---|
| | 680 | SmlBool _verify_user( |
|---|
| | 681 | SmlChal *chal, |
|---|
| | 682 | SmlCred *cred, |
|---|
| | 683 | const char *username, |
|---|
| | 684 | void *userdata, |
|---|
| | 685 | SmlError **error) |
|---|
| | 686 | { |
|---|
| | 687 | osync_trace(TRACE_ENTRY, "%s(%p, %p, %s, %p)", __func__, chal, cred, username, userdata); |
|---|
| 684 | | |
|---|
| 685 | | osync_trace(TRACE_SENSITIVE, "configured is %s, %s", env->username, env->password); |
|---|
| 686 | | if (env->username && (!env->password || !username || !password || strcmp(env->username, username) || strcmp(env->password, password))) { |
|---|
| 687 | | *reply = SML_ERROR_AUTH_REJECTED; |
|---|
| 688 | | } else { |
|---|
| 689 | | *reply = SML_AUTH_ACCEPTED; |
|---|
| 690 | | } |
|---|
| 691 | | osync_trace(TRACE_EXIT, "%s: %i", __func__, *reply); |
|---|
| 692 | | } |
|---|
| 693 | | |
|---|
| | 689 | |
|---|
| | 690 | /* We have only one user and not a whole user database. */ |
|---|
| | 691 | osync_trace(TRACE_EXIT, "%s", __func__); |
|---|
| | 692 | return smlAuthVerify(chal, cred, env->username, env->password, error); |
|---|
| | 693 | } |
|---|
| | 694 | |
|---|