#include "secasn1.h"
-#include <syslog.h>
-
typedef enum {
beforeHeader,
duringContents,
SEC_ASN1EncoderContext *cx;
our_pool = PORT_NewArena (SEC_ASN1_DEFAULT_ARENA_SIZE);
- if (our_pool == NULL) {
- syslog(LOG_ERR,"SEC_ASN1EncoderStart: failed to create new arena");
- return NULL;
- }
+ if (our_pool == NULL)
+ return NULL;
cx = (SEC_ASN1EncoderContext*)PORT_ArenaZAlloc (our_pool, sizeof(*cx));
if (cx == NULL) {
- syslog(LOG_ERR,"SEC_ASN1EncoderStart: failed to alloc");
- PORT_FreeArena (our_pool, PR_FALSE);
- return NULL;
+ PORT_FreeArena (our_pool, PR_FALSE);
+ return NULL;
}
cx->our_pool = our_pool;
* Trouble initializing (probably due to failed allocations)
* requires that we just give up.
*/
- syslog(LOG_ERR, "SEC_ASN1EncoderStart: unable to initialize state");
- PORT_FreeArena (our_pool, PR_FALSE);
- return NULL;
+ PORT_FreeArena (our_pool, PR_FALSE);
+ return NULL;
}
return cx;
rv = SEC_ASN1EncoderUpdate (ecx, NULL, 0);
- if (rv != SECSuccess)
- syslog(LOG_ERR,"SEC_ASN1Encode: encode failure");
-
SEC_ASN1EncoderFinish (ecx);
return rv;
}
encoding_length = 0;
rv = SEC_ASN1Encode (src, theTemplate,
sec_asn1e_encode_item_count, &encoding_length);
- if (rv != SECSuccess) {
- syslog(LOG_ERR, "SEC_ASN1EncodeItem: Encode failed %d", rv);
- return NULL;
- }
+ if (rv != SECSuccess)
+ return NULL;
dest = sec_asn1e_allocate_item (poolp, dest, encoding_length);
- if (dest == NULL) {
- syslog(LOG_ERR, "SEC_ASN1EncodeItem: allocate failure");
- return NULL;
- }
+ if (dest == NULL)
+ return NULL;
/* XXX necessary? This really just checks for a bug in the allocate fn */
PORT_Assert (dest->Data != NULL);
- if (dest->Data == NULL) {
- syslog(LOG_ERR, "SEC_ASN1EncodeItem: data allocate failure");
- return NULL;
- }
+ if (dest->Data == NULL)
+ return NULL;
dest->Length = 0;
(void) SEC_ASN1Encode (src, theTemplate, sec_asn1e_encode_item_store, dest);