From 1ebf5a5fcda0c9154e22ed02404fd46525a7fd9f Mon Sep 17 00:00:00 2001 From: bossiel Date: Wed, 10 Aug 2011 22:59:15 +0000 Subject: Move deprecated v1.0 from trunk to branches --- tinyHTTP/test/test_auth.h | 141 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 tinyHTTP/test/test_auth.h (limited to 'tinyHTTP/test/test_auth.h') diff --git a/tinyHTTP/test/test_auth.h b/tinyHTTP/test/test_auth.h new file mode 100644 index 0000000..5930a1b --- /dev/null +++ b/tinyHTTP/test/test_auth.h @@ -0,0 +1,141 @@ +/* +* 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_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_ */ -- cgit v1.1