|
The Assimilation Monitoring Project
|
Class representing digital signatures - subclass of Frame class. More...
|
Functions | |
| FSTATIC gpointer | _signframe_compute_cksum (GChecksumType cksumtype,gconstpointer tlvptr,gconstpointer pktend) |
| Internal helper routine for computing checksum on data in a frame. More... | |
| FSTATIC gboolean | _signframe_isvalid (const Frame *self,gconstpointer tlvptr,gconstpointer pktend) |
| SignFrame class 'isvalid' member function - verifies the digital signature. More... | |
| FSTATIC void | _signframe_updatedata (Frame *fself,gpointer tlvptr,gconstpointer pktend,FrameSet *fs) |
| Write/update digital signature in packet. More... | |
| SignFrame * | signframe_new (GChecksumType sigtype, gsize framesize) |
| Construct a new SignFrame - allowing for "derived" frame types... More... | |
| Frame * | signframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend) |
| Given marshalled data corresponding to a SignFrame (signature frame), return that corresponding Frame In other words, un-marshall the data... More... | |
| typedef struct _SignFrame | SignFrame |
Class representing digital signatures - subclass of Frame class.
| typedef struct _SignFrame SignFrame |
Definition at line 33 of file signframe.h.
| FSTATIC gpointer _signframe_compute_cksum | ( | GChecksumType | cksumtype, |
| gconstpointer | tlvptr, | ||
| gconstpointer | pktend | ||
| ) |
Internal helper routine for computing checksum on data in a frame.
It is used both for computing checksums on "new" data and verifying checksums on received packets.
| [in] | cksumtype | checksum type |
| [in] | tlvptr | pointer to TLV for checksum |
| [in] | pktend | one byte past end of packet |
Definition at line 62 of file signframe.c.
References FREE, get_generic_tlv_len(), get_generic_tlv_next(), and MALLOC0.
Referenced by _signframe_isvalid(), and _signframe_updatedata().


| FSTATIC gboolean _signframe_isvalid | ( | const Frame * | self, |
| gconstpointer | tlvptr, | ||
| gconstpointer | pktend | ||
| ) |
SignFrame class 'isvalid' member function - verifies the digital signature.
| self | SignFrame object ('this') |
| tlvptr | Pointer to the TLV for this SignFrame |
| pktend | Pointer to one byte past the end of the packet |
Definition at line 111 of file signframe.c.
References _signframe_compute_cksum(), CASTTOCONSTCLASS, FREE, get_generic_tlv_len(), get_generic_tlv_value(), _SignFrame::signaturetype, and tlv_get_guint8().
Referenced by signframe_new().


| FSTATIC void _signframe_updatedata | ( | Frame * | fself, |
| gpointer | tlvptr, | ||
| gconstpointer | pktend, | ||
| FrameSet * | fs | ||
| ) |
Write/update digital signature in packet.
This is based on all the data that follows this frame in the packet. Since this is always the first frame in the packet, that means all data past this initial digital signature frame - all the packet except for this signature frame.
| [in] | fself | SignFrame signature Frame |
| [in,out] | tlvptr | Pointer to our TLV data in the packet |
| [in] | pktend | One byte past end of packet |
| fs | [ignored] FrameSet to update |
Definition at line 168 of file signframe.c.
References _signframe_compute_cksum(), CASTTOCLASS, FREE, get_generic_tlv_nonconst_value(), and tlv_set_guint8().
Referenced by signframe_new().


| SignFrame* signframe_new | ( | GChecksumType | sigtype, |
| gsize | framesize | ||
| ) |
Construct a new SignFrame - allowing for "derived" frame types...
This can be used directly for creating SignFrame frames, or by derived classes.
| sigtype | signature type |
| framesize | size of frame structure (or zero for sizeof(SignFrame)) |
Definition at line 208 of file signframe.c.
References _signframe_isvalid(), _signframe_updatedata(), CASTTOCLASS, frame_new(), FRAMETYPE_SIG, _Frame::isvalid, _Frame::length, proj_class_register_subclassed(), _SignFrame::signaturetype, _Frame::updatedata, and _Frame::value.
Referenced by cma.AssimCclasses.pySignFrame::__init__(), address_tests(), cast_frameset_tests(), main(), and signframe_tlvconstructor().


| Frame* signframe_tlvconstructor | ( | gconstpointer | tlvstart, |
| gconstpointer | pktend | ||
| ) |
Given marshalled data corresponding to a SignFrame (signature frame), return that corresponding Frame In other words, un-marshall the data...
Definition at line 241 of file signframe.c.
References _SignFrame::baseclass, CASTTOCLASS, get_generic_tlv_len(), get_generic_tlv_value(), _Frame::length, signframe_new(), and tlv_get_guint8().
