summaryrefslogtreecommitdiff
path: root/src/hashcomp.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-03 18:57:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-03 18:57:16 +0000
commitd4af574074d05cb5705cd261c8fb97f52290e56a (patch)
treee8ac3a0aa8f85c6b2538a836d7d142e32ed29817 /src/hashcomp.cpp
parent5ec6f8616938a7e2bdf906b43a5bf3f976ace016 (diff)
We now have a test module that can dump someones certificate information: /sslinfo <nick>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5125 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r--src/hashcomp.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 88b9b582c..d3db02da4 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -275,3 +275,21 @@ const std::string irc::commasepstream::GetToken()
irc::commasepstream::~commasepstream()
{
}
+
+std::string irc::hex(const unsigned char *raw, size_t rawsz)
+{
+ if (!rawsz)
+ return "";
+
+ char buf[rawsz*2+1];
+ size_t i;
+
+ for (i = 0; i < rawsz; i++)
+ {
+ sprintf (&(buf[i*2]), "%02x", raw[i]);
+ }
+ buf[i*2] = 0;
+
+ return buf;
+}
+