diff options
author | Konrad Lipinski <k.lipinski2@partner.samsung.com> | 2019-06-11 16:25:51 +0200 |
---|---|---|
committer | Konrad Lipinski <k.lipinski2@samsung.com> | 2019-08-01 14:37:53 +0200 |
commit | cc6febdd37186eeea33bcbce89d79f661ee0009f (patch) | |
tree | 100542f7f8fd3b3c9548150362efe35adde47551 /src/membuf.c | |
parent | c40fbfa8503e7763ef630496852f4d6b5e63b58c (diff) | |
download | xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.tar.gz xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.tar.bz2 xmlsec1-cc6febdd37186eeea33bcbce89d79f661ee0009f.zip |
Import upstream commit c4d0493d545b99194eea1b2b058930d5a9bb91b1 (1.2.28)
Change-Id: I10f71567cb140be223923e1cd0b5895e366ac23e
Diffstat (limited to 'src/membuf.c')
-rw-r--r-- | src/membuf.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/src/membuf.c b/src/membuf.c index 24cca3da..41568c60 100644 --- a/src/membuf.c +++ b/src/membuf.c @@ -1,13 +1,19 @@ -/** +/* * XML Security Library (http://www.aleksey.com/xmlsec). * - * Memory buffer transform * * This is free software; see Copyright file in the source * distribution for preciese wording. * * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. */ +/** + * SECTION:membuf + * @Short_description: Memory buffer transform functions. + * @Stability: Stable + * + */ + #include "globals.h" #include <stdlib.h> @@ -24,7 +30,6 @@ #include <xmlsec/membuf.h> #include <xmlsec/errors.h> - /***************************************************************************** * * Memory Buffer Transform @@ -74,7 +79,7 @@ static xmlSecTransformKlass xmlSecTransformMemBufKlass = { /** * xmlSecTransformMemBufGetKlass: * - * The memory buffer transorm (used to store the data that go through it). + * The memory buffer transform (used to store the data that go through it). * * Returns: memory buffer transform klass. */ @@ -115,11 +120,8 @@ xmlSecTransformMemBufInitialize(xmlSecTransformPtr transform) { ret = xmlSecBufferInitialize(buffer, 0); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferInitialize", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); + xmlSecInternalError("xmlSecBufferInitialize", + xmlSecTransformGetName(transform)); return(-1); } return(0); @@ -162,31 +164,25 @@ xmlSecTransformMemBufExecute(xmlSecTransformPtr transform, int last, xmlSecTrans /* just copy everything from in to our buffer and out */ ret = xmlSecBufferAppend(buffer, xmlSecBufferGetData(in), inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferAppend", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferAppend", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } ret = xmlSecBufferAppend(out, xmlSecBufferGetData(in), inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferAppend", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferAppend", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } ret = xmlSecBufferRemoveHead(in, inSize); if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "xmlSecBufferRemoveHead", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "size=%d", inSize); + xmlSecInternalError2("xmlSecBufferRemoveHead", + xmlSecTransformGetName(transform), + "size=%d", inSize); return(-1); } @@ -197,11 +193,7 @@ xmlSecTransformMemBufExecute(xmlSecTransformPtr transform, int last, xmlSecTrans /* the only way we can get here is if there is no input */ xmlSecAssert2(inSize == 0, -1); } else { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - NULL, - XMLSEC_ERRORS_R_INVALID_STATUS, - "status=%d", transform->status); + xmlSecInvalidTransfromStatusError(transform); return(-1); } return(0); |