| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Key pair generation mechanism - only RSA is supported at present. | 100 // Key pair generation mechanism - only RSA is supported at present. |
| 101 PRUint32 keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN; // from nss/pkcs11t.h | 101 PRUint32 keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN; // from nss/pkcs11t.h |
| 102 | 102 |
| 103 // Temporary structures used for generating the result | 103 // Temporary structures used for generating the result |
| 104 // in the right format. | 104 // in the right format. |
| 105 PK11RSAGenParams rsaKeyGenParams; // Keygen parameters. | 105 PK11RSAGenParams rsaKeyGenParams; // Keygen parameters. |
| 106 SECOidTag algTag; // used by SEC_DerSignData(). | 106 SECOidTag algTag; // used by SEC_DerSignData(). |
| 107 SECKEYPrivateKey *privateKey = NULL; | 107 SECKEYPrivateKey *privateKey = NULL; |
| 108 SECKEYPublicKey *publicKey = NULL; | 108 SECKEYPublicKey *publicKey = NULL; |
| 109 CERTSubjectPublicKeyInfo *spkInfo = NULL; | 109 CERTSubjectPublicKeyInfo *spkInfo = NULL; |
| 110 PRArenaPool *arena = NULL; | 110 PLArenaPool *arena = NULL; |
| 111 SECStatus sec_rv =SECFailure; | 111 SECStatus sec_rv =SECFailure; |
| 112 SECItem spkiItem; | 112 SECItem spkiItem; |
| 113 SECItem pkacItem; | 113 SECItem pkacItem; |
| 114 SECItem signedItem; | 114 SECItem signedItem; |
| 115 CERTPublicKeyAndChallenge pkac; | 115 CERTPublicKeyAndChallenge pkac; |
| 116 void *keyGenParams; | 116 void *keyGenParams; |
| 117 bool isSuccess = true; // Set to false as soon as a step fails. | 117 bool isSuccess = true; // Set to false as soon as a step fails. |
| 118 | 118 |
| 119 std::string result_blob; // the result. | 119 std::string result_blob; // the result. |
| 120 | 120 |
| (...skipping 131 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 |