- return ao;
-}
-
-struct _auth_obj new_authobj(const char *userid, const char *password,
- const char *nonce,
- const unsigned char *secret, const int secsize,
- const unsigned char *payload, const int paysize)
-{
- struct _auth_obj new_ao = {0};
- struct _hash_obj ho_chal, ho_key;
-
- ho_chal = make_challenge(userid, password, nonce);
- if (ho_chal.err) {
- new_ao.err = ho_chal.err;
- return new_ao;
- }
- ho_key = make_key(ho_chal.hash, sizeof(ho_chal.hash), secret, secsize);
- memset(&ho_chal, 0, sizeof(ho_chal));
- if (ho_key.err) {
- new_ao.err = ho_key.err;
- return new_ao;
- }
- new_ao = make_authobj(ho_key.hash, sizeof(ho_key.hash),
- secret, secsize, payload, paysize);