diff --git a/bin/email_hash.js b/bin/email_hash.js new file mode 100755 index 000000000..4ba07c9e0 --- /dev/null +++ b/bin/email_hash.js @@ -0,0 +1,17 @@ +#!/usr/bin/node +// +// Returns a Gravatar stle hash as per: http://en.gravatar.com/site/implement/hash/ +// + +if (process.argv.length != 3) { + process.stderr.write("Usage: " + process.argv[1] + " email_address\n\nReturns gravitar style hash.\n"); + +} else { + var md5 = require('crypto').createHash('md5'); + + md5.update(process.argv[2].trim().toLowerCase()); + + process.stdout.write(md5.digest('hex') + "\n"); +} + +// vim:sw=2:sts=2:ts=8:et diff --git a/bin/hexify.js b/bin/hexify.js new file mode 100755 index 000000000..1c14f646f --- /dev/null +++ b/bin/hexify.js @@ -0,0 +1,22 @@ +#!/usr/bin/node +// +// Returns hex of lowercasing a string. +// + +var stringToHex = function (s) { + return Array.prototype.map.call(s, function (c) { + var b = c.charCodeAt(0); + + return b < 16 ? "0" + b.toString(16) : b.toString(16); + }).join(""); +}; + +if (process.argv.length != 3) { + process.stderr.write("Usage: " + process.argv[1] + " string\n\nReturns hex of lowercasing string.\n"); + +} else { + + process.stdout.write(stringToHex(process.argv[2].toLowerCase()) + "\n"); +} + +// vim:sw=2:sts=2:ts=8:et diff --git a/rippled-example.cfg b/rippled-example.cfg index 3e6ba5bc0..c37cd9c0e 100644 --- a/rippled-example.cfg +++ b/rippled-example.cfg @@ -52,7 +52,7 @@ # # [ips]: # Only valid in "rippled.cfg", "ripple.txt", and the referered [ips_url]. -# List of ips where the Newcoin protocol is avialable. +# List of ips where the Ripple protocol is avialable. # One ipv4 or ipv6 address per line. # A port may optionally be specified after adding a space to the address. # By convention, if known, IPs are listed in from most to least trusted. diff --git a/src/cpp/ripple/Config.cpp b/src/cpp/ripple/Config.cpp index d60cbc6f9..943b5b727 100644 --- a/src/cpp/ripple/Config.cpp +++ b/src/cpp/ripple/Config.cpp @@ -274,7 +274,6 @@ void Config::load() sectionSingleB(secConfig, SECTION_WEBSOCKET_SSL_CERT, WEBSOCKET_SSL_CERT); sectionSingleB(secConfig, SECTION_WEBSOCKET_SSL_CHAIN, WEBSOCKET_SSL_CHAIN); sectionSingleB(secConfig, SECTION_WEBSOCKET_SSL_KEY, WEBSOCKET_SSL_KEY); - if (sectionSingleB(secConfig, SECTION_VALIDATION_SEED, strTemp)) { diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index 123400760..30d5de75f 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -1006,7 +1006,9 @@ Json::Value RPCHandler::doSubmit(Json::Value jvRequest) } if (!txJSON.isMember("Fee") - && ("OfferCreate" == txJSON["TransactionType"].asString() + && ( + "AccountSet" == txJSON["TransactionType"].asString() + || "OfferCreate" == txJSON["TransactionType"].asString() || "OfferCancel" == txJSON["TransactionType"].asString() || "TrustSet" == txJSON["TransactionType"].asString())) { @@ -1353,8 +1355,10 @@ Json::Value RPCHandler::doAccountTransactions(Json::Value jvRequest) } // { -// secret: +// secret: // optional // } +// +// This command requires admin access because it makes no sense to ask an untrusted server for this. Json::Value RPCHandler::doValidationCreate(Json::Value jvRequest) { RippleAddress raSeed; Json::Value obj(Json::objectValue); @@ -1518,6 +1522,7 @@ Json::Value RPCHandler::doWalletPropose(Json::Value jvRequest) Json::Value obj(Json::objectValue); obj["master_seed"] = naSeed.humanSeed(); + obj["master_seed_hex"] = naSeed.getSeed().ToString(); //obj["master_key"] = naSeed.humanSeed1751(); obj["account_id"] = naAccount.humanAccountID(); @@ -2455,7 +2460,7 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole) { "unl_reset", &RPCHandler::doUnlReset, true, optNone }, { "unl_score", &RPCHandler::doUnlScore, true, optNone }, - { "validation_create", &RPCHandler::doValidationCreate, false, optNone }, + { "validation_create", &RPCHandler::doValidationCreate, true, optNone }, { "validation_seed", &RPCHandler::doValidationSeed, false, optNone }, { "wallet_accounts", &RPCHandler::doWalletAccounts, false, optCurrent }, diff --git a/test/jsonrpc-test.js b/test/jsonrpc-test.js index 1c1421666..ffad70ba6 100644 --- a/test/jsonrpc-test.js +++ b/test/jsonrpc-test.js @@ -20,9 +20,6 @@ var serverDelay = 1500; buster.testRunner.timeout = 5000; -var HttpServer = function () { -}; - var server; var server_events;