зеркало из https://github.com/mozilla/pjs.git
Bug 15623. Fixed registration of nsKeygenHandler.
This commit is contained in:
Родитель
c52f68cce4
Коммит
871bde6efa
|
@ -39,9 +39,11 @@ class nsString;
|
|||
class nsVoidArray;
|
||||
|
||||
// {7E4BB410-8740-11d3-967F-00105A1B1B76}
|
||||
#define NS_IFORMPROCESSOR_CID \
|
||||
#define NS_FORMPROCESSOR_CID \
|
||||
{ 0x7e4bb410, 0x8740, 0x11d3, { 0x96, 0x7f, 0x0, 0x10, 0x5a, 0x1b, 0x1b, 0x76 } }
|
||||
|
||||
#define NS_FORMPROCESSOR_PROGID "component://netscape/layout/form-processor"
|
||||
|
||||
// F11C1E20-873F-11d3-967F-00105A1B1B76
|
||||
#define NS_IFORMPROCESSOR_IID \
|
||||
{ 0xf11c1e20, 0x873f, 0x11d3, { 0x96, 0x7f, 0x0, 0x10, 0x5a, 0x1b, 0x1b, 0x76 } }
|
||||
|
|
|
@ -66,6 +66,20 @@ nsKeygenFormProcessor::~nsKeygenFormProcessor()
|
|||
NS_IF_RELEASE(mPSM);
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsKeygenFormProcessor::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_NO_AGGREGATION(aOuter);
|
||||
nsKeygenFormProcessor* formProc = new nsKeygenFormProcessor();
|
||||
if (formProc == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(formProc);
|
||||
rv = formProc->QueryInterface(aIID, aResult);
|
||||
NS_RELEASE(formProc);
|
||||
return rv;
|
||||
}
|
||||
|
||||
char *
|
||||
nsKeygenFormProcessor::ChooseToken(PCMT_CONTROL control,
|
||||
CMKeyGenTagArg *psmarg,
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#ifndef _NSKEYGENHANDLER_H_
|
||||
#define _NSKEYGENHANDLER_H_
|
||||
// Form Processor
|
||||
#include "nsIFormProcessor.h"
|
||||
#include "ssmdefs.h"
|
||||
#include "cmtcmn.h"
|
||||
|
||||
class nsIPSMComponent;
|
||||
|
||||
class nsKeygenFormProcessor : public nsIFormProcessor {
|
||||
public:
|
||||
nsKeygenFormProcessor();
|
||||
virtual ~nsKeygenFormProcessor();
|
||||
|
||||
NS_IMETHOD ProcessValue(nsIDOMHTMLElement *aElement,
|
||||
const nsString& aName,
|
||||
nsString& aValue);
|
||||
|
||||
NS_IMETHOD ProvideContent(const nsString& aFormType,
|
||||
nsVoidArray& aContent,
|
||||
nsString& aAttribute);
|
||||
NS_DECL_ISUPPORTS
|
||||
protected:
|
||||
nsresult GetPublicKey(nsString& value, nsString& challenge,
|
||||
nsString& keyType, nsString& outPublicKey,
|
||||
nsString& pqg);
|
||||
char * ChooseToken(PCMT_CONTROL control, CMKeyGenTagArg *psmarg,
|
||||
CMKeyGenTagReq *reason);
|
||||
char * SetUserPassword(PCMT_CONTROL control, CMKeyGenTagArg *psmarg,
|
||||
CMKeyGenTagReq *reason);
|
||||
nsIPSMComponent *mPSM;
|
||||
};
|
||||
|
||||
#endif //_NSKEYGENHANDLER_H_
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
// Define SDR object constructor
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kFormProcessorCID, NS_IFORMPROCESSOR_CID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSecretDecoderRing, init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFSecretDecoderRing, init)
|
||||
|
@ -157,35 +157,13 @@ static nsModuleComponentInfo components[] =
|
|||
NS_CERTCONTENTLISTEN_CID,
|
||||
NS_CERTCONTENTLISTEN_PROGID,
|
||||
CertContentListenerConstructor
|
||||
},
|
||||
{
|
||||
"Form Processor",
|
||||
NS_FORMPROCESSOR_CID,
|
||||
NS_FORMPROCESSOR_PROGID,
|
||||
nsKeygenFormProcessor::Create
|
||||
}
|
||||
};
|
||||
|
||||
#if 0
|
||||
NS_IMPL_NSGETMODULE("PSMComponent", components);
|
||||
#endif
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
||||
nsIFile* location,
|
||||
nsIModule** result)
|
||||
{
|
||||
nsresult rv;
|
||||
// Put in code to register KEYGEN form input handler.
|
||||
rv= NS_NewGenericModule("PSMComponent",
|
||||
sizeof(components) / sizeof(components[0]),
|
||||
components, nsnull, result);
|
||||
// Register a form processor. The form processor has the opportunity to
|
||||
// modify the value's passed during form submission.
|
||||
nsKeygenFormProcessor* testFormProcessor = new nsKeygenFormProcessor();
|
||||
nsCOMPtr<nsISupports> formProcessor;
|
||||
rv = testFormProcessor->QueryInterface(kISupportsIID,
|
||||
getter_AddRefs(formProcessor));
|
||||
if (NS_SUCCEEDED(rv) && formProcessor) {
|
||||
rv = nsServiceManager::RegisterService(kFormProcessorCID, formProcessor);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||
|
||||
static NS_DEFINE_IID(kFormProcessorCID, NS_IFORMPROCESSOR_CID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
static const char* kNullToken = "Error: Null token given";
|
||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||
|
|
|
@ -39,9 +39,11 @@ class nsString;
|
|||
class nsVoidArray;
|
||||
|
||||
// {7E4BB410-8740-11d3-967F-00105A1B1B76}
|
||||
#define NS_IFORMPROCESSOR_CID \
|
||||
#define NS_FORMPROCESSOR_CID \
|
||||
{ 0x7e4bb410, 0x8740, 0x11d3, { 0x96, 0x7f, 0x0, 0x10, 0x5a, 0x1b, 0x1b, 0x76 } }
|
||||
|
||||
#define NS_FORMPROCESSOR_PROGID "component://netscape/layout/form-processor"
|
||||
|
||||
// F11C1E20-873F-11d3-967F-00105A1B1B76
|
||||
#define NS_IFORMPROCESSOR_IID \
|
||||
{ 0xf11c1e20, 0x873f, 0x11d3, { 0x96, 0x7f, 0x0, 0x10, 0x5a, 0x1b, 0x1b, 0x76 } }
|
||||
|
|
|
@ -130,7 +130,7 @@ static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
|||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
static NS_DEFINE_IID(kFormProcessorCID, NS_IFORMPROCESSOR_CID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
|
|
|
@ -64,7 +64,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||
|
||||
static NS_DEFINE_IID(kFormProcessorCID, NS_IFORMPROCESSOR_CID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
static const char* kNullToken = "Error: Null token given";
|
||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||
|
|
|
@ -117,7 +117,7 @@ static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID);
|
|||
static NS_DEFINE_IID(kMetaCharsetCID, NS_META_CHARSET_CID);
|
||||
static NS_DEFINE_IID(kIMetaCharsetServiceIID, NS_IMETA_CHARSET_SERVICE_IID);
|
||||
|
||||
static NS_DEFINE_IID(kFormProcessorCID, NS_IFORMPROCESSOR_CID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
static NS_DEFINE_IID(kFormProcessorIID, NS_IFORMPROCESSOR_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче