diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 57237b7f3c82..d2d3e7e446dc 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5993,7 +5993,7 @@ bool PDFWriterImpl::finalizeSignature() // Prepare buffer and calculate PDF file digest CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, 0) ) ); - HASHContext *hc = HASH_Create(HASH_AlgSHA1); + boost::scoped_ptr<HASHContext> hc(HASH_Create(HASH_AlgSHA1)); if (!hc) { @@ -6001,7 +6001,7 @@ bool PDFWriterImpl::finalizeSignature() return false; } - HASH_Begin(hc); + HASH_Begin(hc.get()); char *buffer = new char[m_nSignatureContentOffset + 1]; sal_uInt64 bytesRead; @@ -6012,7 +6012,7 @@ bool PDFWriterImpl::finalizeSignature() if (bytesRead != (sal_uInt64)m_nSignatureContentOffset - 1) SAL_WARN("vcl.gdi", "PDF Signing: First buffer read failed!"); - HASH_Update(hc, reinterpret_cast<const unsigned char*>(buffer), bytesRead); + HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer), bytesRead); delete[] buffer; CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1) ) ); @@ -6021,14 +6021,14 @@ bool PDFWriterImpl::finalizeSignature() if (bytesRead != (sal_uInt64) nLastByteRangeNo) SAL_WARN("vcl.gdi", "PDF Signing: Second buffer read failed!"); - HASH_Update(hc, reinterpret_cast<const unsigned char*>(buffer), bytesRead); + HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer), bytesRead); delete[] buffer; SECItem digest; unsigned char hash[SHA1_LENGTH]; digest.data = hash; - HASH_End(hc, digest.data, &digest.len, SHA1_LENGTH); - HASH_Destroy(hc); + HASH_End(hc.get(), digest.data, &digest.len, SHA1_LENGTH); + HASH_Destroy(hc.get()); const char *pass = OUStringToOString( m_aContext.SignPassword, RTL_TEXTENCODING_UTF8 ).getStr(); |