Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: trunk/src/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * 2 *
3 * ***** BEGIN LICENSE BLOCK ***** 3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * 5 *
6 * The contents of this file are subject to the Mozilla Public License Version 6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with 7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at 8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/ 9 * http://www.mozilla.org/MPL/
10 * 10 *
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Sign the DER encoded PublicKeyAndChallenge. 208 // Sign the DER encoded PublicKeyAndChallenge.
209 sec_rv = SEC_DerSignData(arena, &signedItem, pkacItem.data, pkacItem.len, 209 sec_rv = SEC_DerSignData(arena, &signedItem, pkacItem.data, pkacItem.len,
210 privateKey, algTag); 210 privateKey, algTag);
211 if (SECSuccess != sec_rv) { 211 if (SECSuccess != sec_rv) {
212 LOG(ERROR) << "Couldn't sign the DER encoded PublicKeyandChallenge"; 212 LOG(ERROR) << "Couldn't sign the DER encoded PublicKeyandChallenge";
213 isSuccess = false; 213 isSuccess = false;
214 goto failure; 214 goto failure;
215 } 215 }
216 216
217 // Convert the signed public key and challenge into base64/ascii. 217 // Convert the signed public key and challenge into base64/ascii.
218 base::Base64Encode( 218 if (!base::Base64Encode(std::string(reinterpret_cast<char*>(signedItem.data),
219 std::string(reinterpret_cast<char*>(signedItem.data), signedItem.len), 219 signedItem.len),
220 &result_blob); 220 &result_blob)) {
221 LOG(ERROR) << "Couldn't convert signed public key into base64";
222 isSuccess = false;
223 goto failure;
224 }
221 225
222 failure: 226 failure:
223 if (!isSuccess) { 227 if (!isSuccess) {
224 LOG(ERROR) << "SSL Keygen failed! (NSS error code " << PR_GetError() << ")"; 228 LOG(ERROR) << "SSL Keygen failed! (NSS error code " << PR_GetError() << ")";
225 } else { 229 } else {
226 VLOG(1) << "SSL Keygen succeeded!"; 230 VLOG(1) << "SSL Keygen succeeded!";
227 } 231 }
228 232
229 // Do cleanups 233 // Do cleanups
230 if (privateKey) { 234 if (privateKey) {
(...skipping 17 matching lines...) Expand all
248 SECKEY_DestroySubjectPublicKeyInfo(spkInfo); 252 SECKEY_DestroySubjectPublicKeyInfo(spkInfo);
249 } 253 }
250 if (arena) { 254 if (arena) {
251 PORT_FreeArena(arena, PR_TRUE); 255 PORT_FreeArena(arena, PR_TRUE);
252 } 256 }
253 257
254 return (isSuccess ? result_blob : std::string()); 258 return (isSuccess ? result_blob : std::string());
255 } 259 }
256 260
257 } // namespace mozilla_security_manager 261 } // namespace mozilla_security_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698