Added support for MIC (thanks to Mehmet Bozkurt).
This commit is contained in:
parent
2b3424d594
commit
a4cb3dc862
@ -69,11 +69,18 @@ const disposition receivedMDNInfos::getDisposition() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const string receivedMDNInfos::getContentMIC() const
|
||||||
|
{
|
||||||
|
return m_contentMIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void receivedMDNInfos::copyFrom(const receivedMDNInfos& other)
|
void receivedMDNInfos::copyFrom(const receivedMDNInfos& other)
|
||||||
{
|
{
|
||||||
m_msg = other.m_msg;
|
m_msg = other.m_msg;
|
||||||
m_omid = other.m_omid;
|
m_omid = other.m_omid;
|
||||||
m_disp = other.m_disp;
|
m_disp = other.m_disp;
|
||||||
|
m_contentMIC = other.m_contentMIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -109,6 +116,13 @@ void receivedMDNInfos::extract()
|
|||||||
|
|
||||||
try { m_disp = *fields.Disposition()->getValue().dynamicCast <const disposition>(); }
|
try { m_disp = *fields.Disposition()->getValue().dynamicCast <const disposition>(); }
|
||||||
catch (exceptions::no_such_field&) { /* Ignore */ }
|
catch (exceptions::no_such_field&) { /* Ignore */ }
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
text t = *fields.findField("Received-content-MIC")->getValue().dynamicCast <const text>();
|
||||||
|
m_contentMIC = t.generate();
|
||||||
|
}
|
||||||
|
catch (exceptions::no_such_field&) { /* Ignore */ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
const disposition getDisposition() const;
|
const disposition getDisposition() const;
|
||||||
|
|
||||||
|
/** Return the Message Integrity Check (MIC), that is the value
|
||||||
|
* of the "Received-content-MIC" field.
|
||||||
|
*
|
||||||
|
* @return MIC hash value, or an empty string if not specified
|
||||||
|
*/
|
||||||
|
const string getContentMIC() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void copyFrom(const receivedMDNInfos& other);
|
void copyFrom(const receivedMDNInfos& other);
|
||||||
@ -76,6 +83,7 @@ private:
|
|||||||
|
|
||||||
disposition m_disp;
|
disposition m_disp;
|
||||||
messageId m_omid;
|
messageId m_omid;
|
||||||
|
string m_contentMIC;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user