Skip to content

Commit

Permalink
Changed gpgVerify to support optional second argument; re issue #28
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehuff committed Feb 14, 2013
1 parent 4534aa3 commit da9cbd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions webpgPlugin/webpgPluginAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1873,10 +1873,10 @@ FB::variant webpgPluginAPI::gpgDecrypt(const std::string& data)
return webpgPluginAPI::gpgDecryptVerify(data, "", 1);
}

FB::variant webpgPluginAPI::gpgVerify(const std::string& data, const std::string& plaintext)
FB::variant webpgPluginAPI::gpgVerify(const std::string& data, const boost::optional<std::string>& plaintext)
{
if (plaintext.length() > 0)
return webpgPluginAPI::gpgDecryptVerify(data, plaintext, 0);
if (plaintext)
return webpgPluginAPI::gpgDecryptVerify(data, *plaintext, 0);
else
return webpgPluginAPI::gpgDecryptVerify(data, "", 0);
}
Expand Down
3 changes: 2 additions & 1 deletion webpgPlugin/webpgPluginAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Copyright 2011 Kyle L. Huff, CURETHEITCH development team
#include <fstream>
#include "JSAPIAuto.h"
#include "BrowserHost.h"
#include <boost/optional.hpp>
#include "webpgPlugin.h"

#ifdef HAVE_W32_SYSTEM
Expand Down Expand Up @@ -338,7 +339,7 @@ class webpgPluginAPI : public FB::JSAPIAuto
///////////////////////////////////////////////////////////////////////////////
FB::variant gpgDecrypt(const std::string& data);

FB::variant gpgVerify(const std::string& data, const std::string& plaintext);
FB::variant gpgVerify(const std::string& data, const boost::optional<std::string>& plaintext);

///////////////////////////////////////////////////////////////////////////////
/// @fn FB::variant webpgPluginAPI::gpgSignText(FB::VariantList& signers, const std::string& plain_text, int sign_mode)
Expand Down

0 comments on commit da9cbd4

Please sign in to comment.