Commit d13d7eab authored by Martin Straka's avatar Martin Straka

Removed CMS parse patches for WinRT

parent 411515c6
......@@ -30,6 +30,7 @@
#include "src/auxiliaries/attachment_helper.h"
#include "src/auxiliaries/email_helper.h"
#include "src/common.h"
#include "src/crypto/crypto.h"
#include "src/dialogues/dialogues.h"
#include "src/files.h"
#include "src/io/filesystem.h"
......@@ -42,10 +43,6 @@
#include "src/sqlite/message_db_container.h"
#include "src/sqlite/dbs.h"
#ifndef Q_OS_WIN
#include "src/crypto/crypto.h"
#endif
void Files::declareQML(void)
{
qmlRegisterType<Files>("cz.nic.mobileDatovka.files", 1, 0, "FileIdType");
......
......@@ -27,13 +27,10 @@
#include <QFileInfo>
#include "src/auxiliaries/attachment_helper.h"
#include "src/crypto/crypto.h"
#include "src/net/isds_const.h"
#include "src/net/xml_layer.h"
#ifndef Q_OS_WIN
#include "src/crypto/crypto.h"
#endif
XmlLayer::XmlLayer(QObject *parent)
: QObject(parent)
{
......@@ -718,37 +715,6 @@ bool XmlLayer::parseSignedMessageDownloadResponse(const QByteArray &xmlData,
zfoData = cmsData;
#ifdef Q_OS_WIN
QByteArray newRawData;
int skipChars = 0;
/* Skip/remove asn.1 segment delimeters from cms stream */
for (int i = 0; i < cmsData.length(); ++i) {
if (skipChars != 0) {
skipChars--;
continue;
}
char c = cmsData.at(i);
/* 0x04 is first byte of delimeter sequence */
if (c == 0x04) {
skipChars = 3;
continue;
}
newRawData.append(c);
}
/* cut only SOAP XML content from new cms */
int first = newRawData.indexOf("<");
newRawData = newRawData.remove(0, first);
int last = newRawData.lastIndexOf("Response>");
int len = newRawData.length();
newRawData = newRawData.remove(last + 9, len - last - 9);
newRawData.replace("\n", "");
QString soap = QString::fromUtf8(newRawData);
#else
/* decode cms and obtain message xml data - used openssl */
void *xmlContent = NULL;
size_t xmlContentLen = 0;
......@@ -763,8 +729,6 @@ bool XmlLayer::parseSignedMessageDownloadResponse(const QByteArray &xmlData,
QByteArray soap((char*)xmlContent, xmlContentLen);
free(xmlContent); xmlContent = NULL;
#endif
/* add xml SOAP header anf footer */
soap.prepend("<?xml version='1.0' encoding='utf-8'?>"
"<SOAP-ENV:Envelope "
......@@ -1184,37 +1148,6 @@ bool XmlLayer::parseGetSignedMsgDeliveryInfoResponse(const QByteArray &xmlData,
/* decode signature from base64 and obtain something cms message */
QByteArray cmsData = QByteArray::fromBase64(signature);
#ifdef Q_OS_WIN
QByteArray newRawData;
int skipChars = 0;
/* Skip/remove asn.1 segment delimeters from cms stream */
for (int i = 0; i < cmsData.length(); ++i) {
if (skipChars != 0) {
skipChars--;
continue;
}
char c = cmsData.at(i);
/* 0x04 is first byte of delimeter sequence */
if (c == 0x04) {
skipChars = 3;
continue;
}
newRawData.append(c);
}
/* cut only SOAP XML content from new cms */
int first = newRawData.indexOf("<");
newRawData = newRawData.remove(0, first);
int last = newRawData.lastIndexOf("Response>");
int len = newRawData.length();
newRawData = newRawData.remove(last + 9, len - last - 9);
newRawData.replace("\n", "");
QString soap = QString::fromUtf8(newRawData);
#else
/* decode cms and obtain message xml data - used openssl */
void *xmlContent = NULL;
size_t xmlContentLen = 0;
......@@ -1229,8 +1162,6 @@ bool XmlLayer::parseGetSignedMsgDeliveryInfoResponse(const QByteArray &xmlData,
QByteArray soap((char*)xmlContent, xmlContentLen);
free(xmlContent); xmlContent = NULL;
#endif
/* add xml SOAP header anf footer */
soap.prepend("<?xml version='1.0' encoding='utf-8'?>"
"<SOAP-ENV:Envelope "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment