aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-17 23:36:57 +0000
committerlloyd <[email protected]>2008-09-17 23:36:57 +0000
commit73e4e9954d4e6c79a554b8c01d53deba1f6bc1b9 (patch)
tree0f5885df2b86cd33b0c3f3ea3286c2f716f86b51 /misc
parentb1341696de81ddb9c6ce15f8a1c03e4285a51311 (diff)
Fixes for recent API changes in X.509 code
Diffstat (limited to 'misc')
-rw-r--r--misc/xs/Botan.xs17
1 files changed, 14 insertions, 3 deletions
diff --git a/misc/xs/Botan.xs b/misc/xs/Botan.xs
index b675028f1..ded129d2e 100644
--- a/misc/xs/Botan.xs
+++ b/misc/xs/Botan.xs
@@ -18,6 +18,7 @@ extern "C" {
#include <botan/init.h>
#include <botan/oids.h>
#include <botan/x509cert.h>
+#include <botan/x509_ext.h>
/* xsubpp converts ':' to '_' in typemap. We create our types without ':' */
@@ -29,7 +30,7 @@ typedef Botan::Attribute Botan__Attribute;
typedef Botan::Base64_Decoder Botan__Base64_Decoder;
typedef Botan::Base64_Encoder Botan__Base64_Encoder;
typedef Botan::Chain Botan__Chain;
-typedef Botan::Extension Botan__Extension;
+typedef Botan::Certificate_Extension Botan__Extension;
typedef Botan::Filter Botan__Filter;
typedef Botan::Fork Botan__Fork;
typedef Botan::Hex_Decoder Botan__Hex_Decoder;
@@ -719,7 +720,12 @@ char *
Botan__X509_Certificate::subject_info(char *info)
CODE:
try {
- RETVAL = const_cast<char *>(THIS->subject_info(info).c_str());
+ std::vector<std::string> s = THIS->subject_info(info);
+
+ if(s.size() > 0)
+ RETVAL = const_cast<char *>(s[0].c_str());
+ else
+ RETVAL = "err";
}
catch (const std::exception &e) {
croak(e.what());
@@ -731,7 +737,12 @@ char *
Botan__X509_Certificate::issuer_info(char *info)
CODE:
try {
- RETVAL = const_cast<char *>(THIS->issuer_info(info).c_str());
+ std::vector<std::string> s = THIS->subject_info(info);
+
+ if(s.size() > 0)
+ RETVAL = const_cast<char *>(s[0].c_str());
+ else
+ RETVAL = "err";
}
catch (const std::exception &e) {
croak(e.what());