/* * Copyright (C) 2009 Mamadou Diop. * * Contact: Mamadou Diop * * This file is part of Open Source Doubango Framework. * * DOUBANGO is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DOUBANGO is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DOUBANGO. * */ #ifndef _TEST_AUTH_H_ #define _TEST_AUTH_H_ struct auth_basic_msg { const char* userid; const char* password; const char* xres; }; struct auth_basic_msg auth_basic_msgs[] = { { "Aladdin"/*Ali baba*/, "open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" }, }; void test_basic_auth() { char *response = tsk_null; size_t i, size; for(i=0; i OK", i); } else{ TSK_DEBUG_INFO("[HTTP_BASIC-%d] ==> NOK", i); } TSK_FREE(response); } } //======================================================================== struct auth_ws { const char* key; const char* xres; }; struct auth_ws auth_ws_msgs[] = { { "dGhlIHNhbXBsZSBub25jZQ==", "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" }, { "x3JJHMbDL1EzLkh9GBhXDw==", "HSmrc0sMlYUkAGmm5OPpG2HaGWk=" }, }; void test_ws_auth() { thttp_auth_ws_keystring_t response = {0}; size_t i, size; for(i=0; i OK", i); } else{ TSK_DEBUG_INFO("[WS_AUTH-%d] ==> NOK", i); } } } //======================================================================== struct auth_digest_msg { const char* username; const char* password; const char* realm; const char* nonce; const char* method; const char* uri; const char* qop; const char* nc; const char* cnonce; const char* opaque; const char* entitybody; const char* response; }; struct auth_digest_msg auth_digest_msgs[] = { { "Mufasa", "Circle Of Life", "testrealm@host.com", "dcd98b7102dd2f0e8b11d0f600bfb0c093", "GET", "/dir/index.html", "auth", "00000001", "0a4f113b", "5ccc069c403ebaf9f0171e9517f40e41", 0, "6629fae49393a05397450978507c4ef1" } , }; void test_digest_auth() { tsk_md5string_t response, ha1, ha2; size_t i; for(i=0; i OK", i); } else{ TSK_DEBUG_INFO("[HTTP_DIGEST-%d] ==> NOK", i); } } } #endif /* _TEST_AUTH_H_ */