| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include <pk11pub.h> | 43 #include <pk11pub.h> |
| 44 #include <prerror.h> // PR_GetError() | 44 #include <prerror.h> // PR_GetError() |
| 45 #include <secmod.h> | 45 #include <secmod.h> |
| 46 #include <secder.h> // DER_Encode() | 46 #include <secder.h> // DER_Encode() |
| 47 #include <cryptohi.h> // SEC_DerSignData() | 47 #include <cryptohi.h> // SEC_DerSignData() |
| 48 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() | 48 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() |
| 49 | 49 |
| 50 #include "base/base64.h" | 50 #include "base/base64.h" |
| 51 #include "base/logging.h" | 51 #include "base/logging.h" |
| 52 #include "crypto/nss_util.h" | 52 #include "crypto/nss_util.h" |
| 53 #include "googleurl/src/gurl.h" | 53 #include "url/gurl.h" |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 // Template for creating the signed public key structure to be sent to the CA. | 57 // Template for creating the signed public key structure to be sent to the CA. |
| 58 DERTemplate SECAlgorithmIDTemplate[] = { | 58 DERTemplate SECAlgorithmIDTemplate[] = { |
| 59 { DER_SEQUENCE, | 59 { DER_SEQUENCE, |
| 60 0, NULL, sizeof(SECAlgorithmID) }, | 60 0, NULL, sizeof(SECAlgorithmID) }, |
| 61 { DER_OBJECT_ID, | 61 { DER_OBJECT_ID, |
| 62 offsetof(SECAlgorithmID, algorithm), }, | 62 offsetof(SECAlgorithmID, algorithm), }, |
| 63 { DER_OPTIONAL | DER_ANY, | 63 { DER_OPTIONAL | DER_ANY, |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 SECKEY_DestroySubjectPublicKeyInfo(spkInfo); | 252 SECKEY_DestroySubjectPublicKeyInfo(spkInfo); |
| 253 } | 253 } |
| 254 if (arena) { | 254 if (arena) { |
| 255 PORT_FreeArena(arena, PR_TRUE); | 255 PORT_FreeArena(arena, PR_TRUE); |
| 256 } | 256 } |
| 257 | 257 |
| 258 return (isSuccess ? result_blob : std::string()); | 258 return (isSuccess ? result_blob : std::string()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace mozilla_security_manager | 261 } // namespace mozilla_security_manager |
| OLD | NEW |