bug 331648, signed/unsigned bug submitting CRMF cert requests
r=rrelyea, sr=nelson git-svn-id: svn://10.0.0.236/branches/NSS_3_11_BRANCH@193685 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -208,7 +208,7 @@ extern SECStatus CRMF_CertReqMsgSetCertRequest(CRMFCertReqMsg *inCertReqMsg,
|
||||
* A pointer to the new Certificate Request. A NULL return value
|
||||
* indicates an error in creating the Certificate Request.
|
||||
*/
|
||||
extern CRMFCertRequest *CRMF_CreateCertRequest (long inRequestID);
|
||||
extern CRMFCertRequest *CRMF_CreateCertRequest (PRUint32 inRequestID);
|
||||
|
||||
/*
|
||||
* FUNCTION: CRMF_DestroyCertRequest
|
||||
|
||||
@@ -140,7 +140,7 @@ struct CRMFCertRequestStr {
|
||||
* are not part of the encoding.
|
||||
*/
|
||||
PRArenaPool *poolp;
|
||||
long requestID; /* This is the value that will be encoded into
|
||||
PRUint32 requestID; /* This is the value that will be encoded into
|
||||
* the certReqId field.
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -63,6 +63,20 @@ crmf_encode_integer(PRArenaPool *poolp, SECItem *dest, long value)
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
SECStatus
|
||||
crmf_encode_unsigned_integer(PRArenaPool *poolp, SECItem *dest,
|
||||
unsigned long value)
|
||||
{
|
||||
SECItem *dummy;
|
||||
|
||||
dummy = SEC_ASN1EncodeUnsignedInteger(poolp, dest, value);
|
||||
PORT_Assert (dummy == dest);
|
||||
if (dummy != dest) {
|
||||
return SECFailure;
|
||||
}
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
static SECStatus
|
||||
crmf_copy_secitem (PRArenaPool *poolp, SECItem *dest, SECItem *src)
|
||||
{
|
||||
@@ -104,7 +118,8 @@ CRMF_DoesRequestHaveField (CRMFCertRequest *inCertReq,
|
||||
}
|
||||
|
||||
CRMFCertRequest *
|
||||
CRMF_CreateCertRequest (long inRequestID) {
|
||||
CRMF_CreateCertRequest (PRUint32 inRequestID)
|
||||
{
|
||||
PRArenaPool *poolp;
|
||||
CRMFCertRequest *certReq;
|
||||
SECStatus rv;
|
||||
@@ -122,7 +137,8 @@ CRMF_CreateCertRequest (long inRequestID) {
|
||||
certReq->poolp = poolp;
|
||||
certReq->requestID = inRequestID;
|
||||
|
||||
rv = crmf_encode_integer(poolp, &(certReq->certReqId), inRequestID);
|
||||
rv = crmf_encode_unsigned_integer(poolp, &(certReq->certReqId),
|
||||
inRequestID);
|
||||
if (rv != SECSuccess) {
|
||||
goto loser;
|
||||
}
|
||||
|
||||
@@ -874,6 +874,7 @@ SECMOD_OpenUserDB;
|
||||
;+};
|
||||
;+NSS_3.11.1 {
|
||||
;+ global:
|
||||
SEC_ASN1EncodeUnsignedInteger;
|
||||
SEC_RegisterDefaultHttpClient;
|
||||
;+ local:
|
||||
;+ *;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
* Support for ENcoding ASN.1 data based on BER/DER (Basic/Distinguished
|
||||
* Encoding Rules).
|
||||
*
|
||||
* $Id: secasn1e.c,v 1.20 2005-09-30 19:22:48 relyea%netscape.com Exp $
|
||||
* $Id: secasn1e.c,v 1.20.2.1 2006-04-06 12:34:55 kaie%kuix.de Exp $
|
||||
*/
|
||||
|
||||
#include "secasn1.h"
|
||||
@@ -1639,7 +1639,7 @@ SEC_ASN1EncodeInteger(PRArenaPool *poolp, SECItem *dest, long value)
|
||||
}
|
||||
|
||||
|
||||
extern SECItem *
|
||||
SECItem *
|
||||
SEC_ASN1EncodeUnsignedInteger(PRArenaPool *poolp,
|
||||
SECItem *dest, unsigned long value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user