зеркало из https://github.com/mozilla/gecko-dev.git
bug 331648, signed/unsigned bug submitting CRMF cert requests
r=rrelyea, sr=nelson
This commit is contained in:
Родитель
323475809a
Коммит
1c0c7bbeb8
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -886,6 +886,7 @@ VFY_VerifyDigestWithAlgorithmID;
|
|||
;+};
|
||||
;+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.21 2006/04/07 11:41:18 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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче