Base64 decoding should handle lack of newlines in encoded string

If there are no new lines in the input string, it seems we have to set
the BIO_FLAGS_BASE64_NO_NL flag. Without this flag, BIO_read just
returns a decode string full of zeroes. So in this CL, we canonicalize
the input by stripping of all the newlines and then set this flag so
that decoding work for all cases.

Note: Currently the unit tests use a different library than what paygen
uses and happens to encode a string with newline (which is why the
previous code worked fine and we only found out this issue when paygen
code changes were done). Hence we canonicalize the input.

Work Item 34173 tracks adding a no-new-line variation to the unit tests
so that it tests both case.

BUG=chromium-os:35423
TEST=Unit Tests pass, tested end to end on ZGB.

Change-Id: Ieccb94c91feb5147ea19664e5a381e24cd5ff646
Reviewed-on: https://gerrit.chromium.org/gerrit/35857
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/omaha_hash_calculator.h b/omaha_hash_calculator.h
index a9c59d4..bea3cc9 100644
--- a/omaha_hash_calculator.h
+++ b/omaha_hash_calculator.h
@@ -79,8 +79,9 @@
 
   // Decodes given base64-encoded in string into the out vector. Since the
   // output can have null characters, we're returning a byte vector instead of
-  // a string.
-  static bool Base64Decode(const std::string& in, std::vector<char>* out);
+  // a string. This method works fine even if |raw_in| has any newlines.
+  // Any existing contents of |out| will be erased.
+  static bool Base64Decode(const std::string& raw_in, std::vector<char>* out);
 
  private:
   // If non-empty, the final base64 encoded hash and the raw hash. Will only be