summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--COPYING2
-rw-r--r--NEWS.xml8
-rw-r--r--configure.ac2
-rw-r--r--include/opkele/expat.h3
-rw-r--r--lib/basic_rp.cc1
-rw-r--r--lib/discovery.cc53
-rw-r--r--lib/expat.cc9
7 files changed, 61 insertions, 17 deletions
diff --git a/COPYING b/COPYING
index 06cc949..46d3f30 100644
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
1Copyright (c) 2005-2007 Klever Group (http://www.klever.net/) 1Copyright (c) 2005-2008 Klever Group (http://www.klever.net/)
2 2
3Permission is hereby granted, free of charge, to any person obtaining a copy of 3Permission is hereby granted, free of charge, to any person obtaining a copy of
4this software and associated documentation files (the "Software"), to deal in 4this software and associated documentation files (the "Software"), to deal in
5the Software without restriction, including without limitation the rights to 5the Software without restriction, including without limitation the rights to
6use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 6use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7of the Software, and to permit persons to whom the Software is furnished to do 7of the Software, and to permit persons to whom the Software is furnished to do
diff --git a/NEWS.xml b/NEWS.xml
index b20576f..160b197 100644
--- a/NEWS.xml
+++ b/NEWS.xml
@@ -1,8 +1,16 @@
1<?xml version="1.0" encoding="us-ascii"?> 1<?xml version="1.0" encoding="us-ascii"?>
2<news> 2<news>
3 <version version="2.0.1" date="November 22nd, 2008">
4 <ni>Compile-time fixes and improvements</ni>
5 <ni>Portability improvements for FreeBSD</ni>
6 <ni>Really suppress debugging message from htmltidy when --disable-debug is in
7 effect</ni>
8 <ni>minor bugfixes</ni>
9 <ni>thread-safety improvements</ni>
10 </version>
3 <version version="2.0" date="June 26th, 2008"> 11 <version version="2.0" date="June 26th, 2008">
4 <ni>OpenID 2.0 support</ni> 12 <ni>OpenID 2.0 support</ni>
5 <ni>Major rewrite of the whole thing</ni> 13 <ni>Major rewrite of the whole thing</ni>
6 <ni>Support for XRDS (YADIS and XRI/inames) discovery</ni> 14 <ni>Support for XRDS (YADIS and XRI/inames) discovery</ni>
7 <ni>Sheerly improved html-based discovery (only code using new, 2.0-enabled 15 <ni>Sheerly improved html-based discovery (only code using new, 2.0-enabled
8 classes benefits from it)</ni> 16 classes benefits from it)</ni>
diff --git a/configure.ac b/configure.ac
index 3484146..a7b56ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
1AC_INIT([libopkele], [2.0], [libopkele-bugs@klever.net]) 1AC_INIT([libopkele], [2.0.1], [libopkele-bugs@klever.net])
2AC_CONFIG_SRCDIR([include/opkele/opkele-config.h]) 2AC_CONFIG_SRCDIR([include/opkele/opkele-config.h])
3AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h]) 3AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h])
4AM_INIT_AUTOMAKE([dist-bzip2]) 4AM_INIT_AUTOMAKE([dist-bzip2])
5 5
6AC_PROG_INSTALL 6AC_PROG_INSTALL
7AC_PROG_CXX 7AC_PROG_CXX
diff --git a/include/opkele/expat.h b/include/opkele/expat.h
index 3ab1630..21be003 100644
--- a/include/opkele/expat.h
+++ b/include/opkele/expat.h
@@ -23,12 +23,15 @@ namespace opkele {
23 23
24 inline bool parse(const char *s,int len,bool final=false) { 24 inline bool parse(const char *s,int len,bool final=false) {
25 assert(_x); 25 assert(_x);
26 return XML_Parse(_x,s,len,final); 26 return XML_Parse(_x,s,len,final);
27 } 27 }
28 28
29 virtual int unknown_encoding(const XML_Char * /* n */,XML_Encoding * /* i */) { return XML_STATUS_ERROR; }
30 void set_unknown_encoding_handler();
31
29 virtual void start_element(const XML_Char * /* n */,const XML_Char ** /* a */) { } 32 virtual void start_element(const XML_Char * /* n */,const XML_Char ** /* a */) { }
30 virtual void end_element(const XML_Char * /* n */) { } 33 virtual void end_element(const XML_Char * /* n */) { }
31 void set_element_handler(); 34 void set_element_handler();
32 35
33 virtual void character_data(const XML_Char * /* s */,int /* l */) { } 36 virtual void character_data(const XML_Char * /* s */,int /* l */) { }
34 void set_character_data_handler(); 37 void set_character_data_handler();
diff --git a/lib/basic_rp.cc b/lib/basic_rp.cc
index 3357d0b..3cad71c 100644
--- a/lib/basic_rp.cc
+++ b/lib/basic_rp.cc
@@ -1,6 +1,7 @@
1#include <sys/types.h>
1#include <cassert> 2#include <cassert>
2#include <openssl/sha.h> 3#include <openssl/sha.h>
3#include <openssl/hmac.h> 4#include <openssl/hmac.h>
4#include <opkele/basic_rp.h> 5#include <opkele/basic_rp.h>
5#include <opkele/exception.h> 6#include <opkele/exception.h>
6#include <opkele/uris.h> 7#include <opkele/uris.h>
diff --git a/lib/discovery.cc b/lib/discovery.cc
index bd1f917..26f3eed 100644
--- a/lib/discovery.cc
+++ b/lib/discovery.cc
@@ -280,12 +280,13 @@ namespace opkele {
280 } 280 }
281 281
282 void prepare_to_parse() { 282 void prepare_to_parse() {
283 (*(expat_t*)this) = parser_create_ns(); 283 (*(expat_t*)this) = parser_create_ns();
284 set_user_data(); set_element_handler(); 284 set_user_data(); set_element_handler();
285 set_character_data_handler(); 285 set_character_data_handler();
286 set_unknown_encoding_handler();
286 287
287 if(xmode&xmode_html) { 288 if(xmode&xmode_html) {
288 html_openid1.clear(); html_openid2.clear(); 289 html_openid1.clear(); html_openid2.clear();
289 parser_choked = false; 290 parser_choked = false;
290 } 291 }
291 292
@@ -450,31 +451,46 @@ namespace opkele {
450 void end_element(const XML_Char *n) { 451 void end_element(const XML_Char *n) {
451 if(skipping<0) return; 452 if(skipping<0) return;
452 if(skipping) { 453 if(skipping) {
453 --skipping; return; 454 --skipping; return;
454 } 455 }
455 if(is_qelement(n,NSURI_XRD "\tType")) { 456 if(is_qelement(n,NSURI_XRD "\tType")) {
456 assert(xrd); assert(xrd_service); assert(cdata==&cdata_buf); 457 if(xrd && xrd_service) {
457 xrd_service->types.insert(cdata_buf); 458 assert(cdata==&cdata_buf);
459 xrd_service->types.insert(cdata_buf);
460 }
458 }else if(is_qelement(n,NSURI_XRD "\tService")) { 461 }else if(is_qelement(n,NSURI_XRD "\tService")) {
459 assert(xrd); assert(xrd_service); 462 if(!(xrd && xrd_service)) {
460 assert(!pt_stack.empty()); 463 skipping = -1;
461 assert(pt_stack.back()==(NSURI_XRD "\tService")); 464 }else{
462 pt_stack.pop_back(); 465 assert(!pt_stack.empty());
463 xrd_service = 0; 466 assert(pt_stack.back()==(NSURI_XRD "\tService"));
464 }else if(is_qelement(n,NSURI_XRD "\tStatus")) {
465 assert(xrd);
466 if(is_qelement(pt_stack.back().c_str(),n)) {
467 assert(cdata==&status_string);
468 pt_stack.pop_back(); 467 pt_stack.pop_back();
469 if(status_code!=100) 468 xrd_service = 0;
470 skipping = -1; 469 }
470 }else if(is_qelement(n,NSURI_XRD "\tStatus")) {
471 if(!xrd) {
472 skipping=-1;
473 }else{
474 if(is_qelement(pt_stack.back().c_str(),n)) {
475 assert(cdata==&status_string);
476 pt_stack.pop_back();
477 if(status_code!=100)
478 skipping = -1;
479 }
471 } 480 }
472 }else if(is_qelement(n,NSURI_XRD "\tExpires")) { 481 }else if(is_qelement(n,NSURI_XRD "\tExpires")) {
473 assert(xrd); 482 if(!xrd) {
474 xrd->expires = util::w3c_to_time(cdata_buf); 483 skipping=-1;
484 }else{
485 xrd->expires = util::w3c_to_time(cdata_buf);
486 }
487 }else if(is_qelement(n,NSURI_XRD "\tXRD")) {
488 assert(!pt_stack.empty());
489 assert(pt_stack.back()==(NSURI_XRD "\tXRD"));
490 pt_stack.pop_back();
475 }else if((xmode&xmode_html) && is_element(n,"head")) { 491 }else if((xmode&xmode_html) && is_element(n,"head")) {
476 skipping = -1; 492 skipping = -1;
477 } 493 }
478 cdata = 0; 494 cdata = 0;
479 } 495 }
480 void character_data(const XML_Char *s,int l) { 496 void character_data(const XML_Char *s,int l) {
@@ -566,12 +582,19 @@ namespace opkele {
566 } 582 }
567 } 583 }
568 } 584 }
569 } 585 }
570 } 586 }
571 587
588 int unknown_encoding(const XML_Char *n,XML_Encoding *i) {
589 for(int ii=0;ii < sizeof(i->map)/sizeof(i->map[0]);++ii)
590 i->map[ii] = ii;
591 i->convert = 0; i->release = 0;
592 return XML_STATUS_OK;
593 }
594
572 }; 595 };
573 596
574 string idiscover(endpoint_discovery_iterator oi,const string& identity) { 597 string idiscover(endpoint_discovery_iterator oi,const string& identity) {
575 idigger_t idigger; 598 idigger_t idigger;
576 return idigger.discover(oi,identity); 599 return idigger.discover(oi,identity);
577 } 600 }
diff --git a/lib/expat.cc b/lib/expat.cc
index c4dab7e..fb58a9a 100644
--- a/lib/expat.cc
+++ b/lib/expat.cc
@@ -89,9 +89,18 @@ namespace opkele {
89 89
90 void expat_t::set_namespace_decl_handler() { 90 void expat_t::set_namespace_decl_handler() {
91 assert(_x); 91 assert(_x);
92 XML_SetNamespaceDeclHandler(_x,_start_namespace_decl,_end_namespace_decl); 92 XML_SetNamespaceDeclHandler(_x,_start_namespace_decl,_end_namespace_decl);
93 } 93 }
94 94
95 static int _unknown_encoding(void *ehd,const XML_Char *n,XML_Encoding *i) {
96 return ((expat_t*)ehd)->unknown_encoding(n,i);
97 }
98
99 void expat_t::set_unknown_encoding_handler() {
100 assert(_x);
101 XML_SetUnknownEncodingHandler(_x,_unknown_encoding,this);
102 }
103
95 } 104 }
96 105
97} 106}