tree checksum vpatch file split hunks

all signers: diana_coman

antecedents: smg_comms_skeys_smsgs smg_comms_io_rsa_tests_only

press order:

smg_comms_genesisdiana_coman
smg_comms_raw_typesdiana_coman
smg_comms_packing_serpentdiana_coman
smg_comms_c_wrappersdiana_coman
smg_comms_rsa_oaepdiana_coman
smg_comms_packing_rsadiana_coman
smg_comms_80colsdiana_coman
smg_comms_skeys_smsgsdiana_coman
smg_comms_io_rsa_tests_onlydiana_coman
smg_comms_keymgmdiana_coman

patch:

- 74EC120B48CC4434D960AF06970594E47C843327FB3C12314CF1C68B7C5FD0899BF402E431398D0C5FF1F12B9151A9EB87915CBE4746E537FDC3376948F596AF
+ 8C55EF6A254359BF52A32B6D58F2A954184505EE4294B2CD1F7F6DD29911B873ABA792EB6B88F9D62653CCB3D6D0FDDF88146635729154848FAC78BE60418BA2
smg_comms/manifest
(7 . 3)(7 . 4)
5 548894 smg_comms_80cols diana_coman Changes tests for RSA to read the key from a file in order to avoid lines > 80 columns in the code itself.
6 549511 smg_comms_skeys_smsgs diana_coman Defines data structures and message types as well as methods for reading/writing Serpent keysets to/from Serpent messages.
7 549785 smg_comms_io_rsa_tests_only diana_coman Small refactoring of tests extracting the reading of RSA key into package of its own so it can be used throughout tests and thus get rid of the too long lines in test_packing.adb.
8 550310 smg_comms_keymgm diana_coman Adds read/write for Keys Management messages (both Serpent and RSA). Refactors the read/write of Serpent Keys messages so that the same core is called by RSA/Serpent specific-methods, adding also read/write of keys from/to RSA messages.
- 50379B31ED9F6B3E63C7037DB679ADE8309A44C6B0510520288AFC535A8FFD55E006CC20A479374E992991116253625C588278B21B0E12C254AD035A64E57258
+ 30B66C681C3DE5AD3731A40C47760D77D58707D32B66D8A8BB987898067A631BF761ADEE878B08F77FE8D83DF097900F8990CA75E02CB0A2AEEC1A58A5209C4D
smg_comms/src/data_structs.ads
(5 . 6)(5 . 7)
13 with Raw_Types; -- for protocol raw types
14 with System; -- for Bit_Order
15 with Serpent; -- for Serpent.Key type
16 with Ada.Unchecked_Conversion; -- for counter_8bits to/from octet
17
18 package Data_Structs is
19 Pragma Pure(Data_Structs);
(65 . 7)(66 . 12)
21
22 ------------------------------
23 -- Serpent Keys Management
24 type Keys_Mgm (N_Burnt: Interfaces.Unsigned_8) is
25 subtype Counter_8bits is Natural range 0..255;
26 function Cast is new Ada.Unchecked_Conversion( Counter_8bits,
27 Raw_Types.Octets_1 );
28 function Cast is new Ada.Unchecked_Conversion( Raw_Types.Octets_1,
29 Counter_8bits );
30 type Keys_Mgm (N_Burnt: Counter_8bits := 0) is
31 record
32 -- count of server keys requested
33 N_Server: Interfaces.Unsigned_8;
(74 . 7)(80 . 12)
35 -- ID of Serpent key preferred for further inbound Serpent msgs.
36 Key_ID : Interfaces.Unsigned_8;
37 -- IDs of Serpent keys burnt by this message
38 Burnt : SKeys_Array( 1..N_Burnt );
39 case N_Burnt is
40 when 0 =>
41 null;
42 when others =>
43 Burnt : Raw_Types.Octets( 1..N_Burnt );
44 end case;
45 end record;
46
47 end Data_Structs;
- 899126526FA67B199AE8B8C17F0DCBBB68F59E0C6E88BFB21DACAC13D02FC11F3C6A2AF97920AFD44660C7AC689B51D474E3671CDDEE4443EEEAA5891CA374E6
+ 796122DCF307899111D2909509460B1DE5215EF1DFADB88AF3F3B2654754AA225ACF79FF0B50BE884F184966920BCD30E236585FA46846DC36B8F58F67C726D1
smg_comms/src/messages.adb
(7 . 16)(7 . 128)
52
53 package body Messages is
54
55 ----------------------
56 -- Serpent Messages --
57 ----------------------
58
59 procedure Write_SKeys_SMsg( Keyset : in Serpent_Keyset;
60 Counter : in Interfaces.Unsigned_16;
61 Msg : out Raw_Types.Serpent_Msg) is
62 begin
63 -- call internal write on Octets with correct type id
64 Write_SKeys( Keyset, Counter, SKeys_S_Type, Msg );
65 end Write_SKeys_SMsg;
66
67
68 -- Reads a Serpent keyset from given Serpent Message
69 procedure Read_SKeys_SMsg( Msg : in Raw_Types.Serpent_Msg;
70 Counter : out Interfaces.Unsigned_16;
71 Keyset : out Serpent_Keyset) is
72 begin
73 -- check type id and call internal Read_SKeys if correct
74 if Msg(Msg'First) /= SKeys_S_Type then
75 raise Invalid_Msg;
76 else
77 Read_SKeys( Msg, Counter, Keyset );
78 end if;
79 end Read_SKeys_SMsg;
80
81 -- writes given key mgm structure into a Serpent message
82 procedure Write_KMgm_SMsg( KMgm : in Keys_Mgm;
83 Counter : in Interfaces.Unsigned_16;
84 Msg : out Raw_Types.Serpent_Msg) is
85 begin
86 -- call internal write of key mgm with correct type ID
87 Write_KMgm( KMgm, Counter, Key_Mgm_S_Type, Msg );
88 end Write_KMgm_SMsg;
89
90 -- reads a key mgm structure from the given Serpent message
91 procedure Read_KMgm_SMsg( Msg : in Raw_Types.Serpent_Msg;
92 Counter : out Interfaces.Unsigned_16;
93 KMgm : out Keys_Mgm) is
94 begin
95 -- check type id and call internal Read_KMgm if correct
96 if Msg(Msg'First) /= Key_Mgm_S_Type then
97 raise Invalid_Msg;
98 else
99 Read_KMgm( Msg, Counter, KMgm );
100 end if;
101 end Read_KMgm_SMsg;
102
103
104 ------------------
105 -- RSA Messages --
106 ------------------
107
108 procedure Write_SKeys_RMsg( Keyset : in Serpent_Keyset;
109 Counter : in Interfaces.Unsigned_16;
110 Msg : out Raw_Types.RSA_Msg) is
111 begin
112 -- call internal write of Serpent keys with correct type ID
113 Write_SKeys( Keyset, Counter, SKeys_R_Type, Msg );
114 end Write_SKeys_RMsg;
115
116 procedure Read_SKeys_RMsg( Msg : in Raw_Types.RSA_Msg;
117 Counter : out Interfaces.Unsigned_16;
118 Keyset : out Serpent_Keyset) is
119 begin
120 -- check type id and call internal Read_SKeys if correct
121 if Msg(Msg'First) /= SKeys_R_Type then
122 raise Invalid_Msg;
123 else
124 Read_SKeys( Msg, Counter, Keyset );
125 end if;
126 end Read_SKeys_RMsg;
127
128 procedure Write_KMgm_RMsg( KMgm : in Keys_Mgm;
129 Counter : in Interfaces.Unsigned_16;
130 Msg : out Raw_Types.RSA_Msg) is
131 begin
132 -- call internal write of key mgm with correct type ID
133 Write_KMgm( KMgm, Counter, Key_Mgm_R_Type, Msg );
134 end Write_KMgm_RMsg;
135
136 procedure Read_KMgm_RMsg( Msg : in Raw_Types.RSA_Msg;
137 Counter : out Interfaces.Unsigned_16;
138 KMgm : out Keys_Mgm) is
139 begin
140 -- check type id and call internal Read_KMgm if correct
141 if Msg(Msg'First) /= Key_Mgm_R_Type then
142 raise Invalid_Msg;
143 else
144 Read_KMgm( Msg, Counter, KMgm );
145 end if;
146 end Read_KMgm_RMsg;
147
148 ------------------
149 -- private part --
150 ------------------
151 procedure Cast_LE( LE: in out Raw_Types.Octets ) is
152 begin
153 -- flip octets ONLY if native is big endian.
154 if System.Default_Bit_Order = System.High_Order_First then
155 declare
156 BE: constant Raw_Types.Octets := LE;
157 begin
158 for I in 1..LE'Length loop
159 LE(LE'First+I-1) := BE(BE'Last-I+1);
160 end loop;
161 end;
162 end if;
163 -- NOTHING to do for native little endian
164 end Cast_LE;
165
166 procedure Write_SKeys( Keyset : in Serpent_Keyset;
167 Counter : in Interfaces.Unsigned_16;
168 Type_ID : in Interfaces.Unsigned_8;
169 Msg : out Raw_Types.Octets) is
170 Pos : Integer := Msg'First;
171 Check : CRC32.CRC32;
172 PadLen: Integer;
173 K : Serpent.Key;
174 begin
175 -- write Type ID
176 Msg(Pos) := SKeys_S_Type;
177 Msg(Pos) := Type_ID;
178 Pos := Pos + 1;
179
180 -- write count of keys (NB: this IS 8 bits by definition)
(60 . 17)(172 . 17)
182 Msg(Pos..Pos+PadLen-1) := Pad;
183 end;
184 end if;
185 end Write_SKeys_SMsg;
186
187 end Write_SKeys;
188
189 -- Reads a Serpent keyset from given Serpent Message
190 procedure Read_SKeys_SMsg( Msg : in Raw_Types.Serpent_Msg;
191 Counter : out Interfaces.Unsigned_16;
192 Keyset : out Serpent_Keyset) is
193 procedure Read_SKeys( Msg : in Raw_Types.Octets;
194 Counter : out Interfaces.Unsigned_16;
195 Keyset : out Serpent_Keyset) is
196 Pos: Integer := Msg'First;
197 begin
198 -- read type and check
199 if Msg(Pos) = SKeys_S_Type then
200 if Msg(Pos) = SKeys_S_Type or
201 Msg(Pos) = SKeys_R_Type then
202 Pos := Pos + 1;
203 else
204 raise Invalid_Msg;
(118 . 22)(230 . 100)
206 else
207 raise Invalid_Msg;
208 end if;
209 end Read_SKeys_SMsg;
210 end Read_SKeys;
211
212 -- private part
213 procedure Cast_LE( LE: in out Raw_Types.Octets ) is
214 -- writes given key management structure to the given octets array
215 procedure Write_KMgm( KMgm : in Keys_Mgm;
216 Counter : in Interfaces.Unsigned_16;
217 Type_ID : in Interfaces.Unsigned_8;
218 Msg : out Raw_Types.Octets) is
219 Pos : Integer := Msg'First;
220 begin
221 -- flip octets ONLY if native is big endian.
222 if System.Default_Bit_Order = System.High_Order_First then
223 declare
224 BE: constant Raw_Types.Octets := LE;
225 begin
226 for I in 1..LE'Length loop
227 LE(LE'First+I-1) := BE(BE'Last-I+1);
228 end loop;
229 end;
230 -- write given type id
231 Msg(Pos) := Type_ID;
232 Pos := Pos + 1;
233
234 -- write count of server keys requested
235 Msg(Pos) := KMgm.N_Server;
236 Pos := Pos + 1;
237
238 -- write count of client keys requested
239 Msg(Pos) := KMgm.N_Client;
240 Pos := Pos + 1;
241
242 -- write id of key preferred for further inbound Serpent messages
243 Msg(Pos) := KMgm.Key_ID;
244 Pos := Pos + 1;
245
246 -- write count of burnt keys in this message
247 Msg(Pos..Pos) := Cast( KMgm.N_Burnt );
248 Pos := Pos + 1;
249
250 -- if there are any burnt keys, write their ids
251 if KMgm.N_Burnt > 0 then
252 Msg( Pos .. Pos + KMgm.Burnt'Length - 1 ) := KMgm.Burnt;
253 Pos := Pos + KMgm.Burnt'Length;
254 end if;
255 -- NOTHING to do for native little endian
256 end Cast_LE;
257
258 -- write the message count
259 Msg(Pos..Pos+1) := Raw_Types.Cast( Counter );
260 Cast_LE( Msg(Pos..Pos+1) );
261 Pos := Pos + 2;
262
263 -- pad with random octets until the end of Msg
264 RNG.Get_Octets( Msg(Pos..Msg'Last) );
265
266 end Write_KMgm;
267
268 -- attempts to read from the given array of octets a key management structure
269 procedure Read_KMgm( Msg : in Raw_Types.Octets;
270 Counter : out Interfaces.Unsigned_16;
271 KMgm : out Keys_Mgm) is
272 Pos : Integer := Msg'First;
273 Burnt_Pos : Integer := Msg'First + 4;
274 begin
275 -- read type and check
276 if Msg(Pos) = Key_Mgm_S_Type or
277 Msg(Pos) = Key_Mgm_R_Type then
278 Pos := Pos + 1;
279 else
280 raise Invalid_Msg;
281 end if;
282
283 -- read the count of burnt keys and check
284 -- NB: Burnt_Pos IS in range of Counter_8bits since it's an octet
285 declare
286 N_Burnt : Counter_8bits := Counter_8bits(Msg(Burnt_Pos));
287 Mgm : Keys_Mgm(N_Burnt);
288 O2 : Raw_Types.Octets_2;
289 begin
290 -- read count of server keys requested
291 Mgm.N_Server := Msg(Pos);
292 Pos := Pos + 1;
293
294 -- read count of client keys requested
295 Mgm.N_Client := Msg(Pos);
296 Pos := Pos + 1;
297
298 -- read ID of Serpent key preferred for further inbound messages
299 Mgm.Key_ID := Msg(Pos);
300 Pos := Pos + 2; --skip the count of burnt keys as it's read already
301
302 -- read ids of burnt keys, if any
303 if N_Burnt > 0 then
304 Mgm.Burnt := Msg(Pos..Pos+N_Burnt-1);
305 Pos := Pos + N_Burnt;
306 end if;
307
308 -- read and set message counter
309 O2 := Msg(Pos..Pos+1);
310 Cast_LE(O2);
311 Counter := Raw_Types.Cast(O2);
312 -- rest of message is padding so it's ignored
313 -- copy the keys mgm structure to output param
314 KMgm := Mgm;
315 end;
316 end Read_KMgm;
317
318
319 end Messages;
- 1190FB877B7956B9B38F1D817858FE872F6E93B7E4FAC674BF3C82D664ACB11204FC88DE2563B33298A2A9AD547343CDF03F2CF068B3B1208DB0B1EE0B3C246C
+ 32CD2279D2E7501F1C713A414424C1BB37D4C54FD279B14221ED6409431C47F469DCCFFE0B5ED303B1E3B2C77B2D7BB81E7902A4FACD4D96B8E28522A71BB69F
smg_comms/src/messages.ads
(21 . 7)(21 . 11)
324 -- exception raised when given message to read fails sanity checks
325 Invalid_Msg: exception;
326
327 ------------------------------------------------
328 ----------------------
329 -- Serpent Messages --
330 ----------------------
331
332 -------------------------Keys----------------------------------------
333 -- Writes a Serpent Keyset to the given Serpent Message
334 --
335 -- Keyset - the set of keys to write to message
(37 . 6)(41 . 61)
337 Counter : out Interfaces.Unsigned_16;
338 Keyset : out Serpent_Keyset);
339
340 ------------------------Keys Management------------------------------
341 -- Writes a Key Management structure to the given Serpent Message
342 --
343 -- KMgm - the keys management structure to write to message
344 -- Counter - the message count
345 procedure Write_KMgm_SMsg( KMgm : in Keys_Mgm;
346 Counter : in Interfaces.Unsigned_16;
347 Msg : out Raw_Types.Serpent_Msg);
348
349 -- Reads a Key management structure from the given Serpent Message
350 -- The opposite of Write_KMgm_SMsg above
351 -- Raises Invalid_Message exception if given message fails sanity checks
352 procedure Read_KMgm_SMsg( Msg : in Raw_Types.Serpent_Msg;
353 Counter : out Interfaces.Unsigned_16;
354 KMgm : out Keys_Mgm);
355
356
357
358 ------------------
359 -- RSA Messages --
360 ------------------
361
362 -------------------------Keys----------------------------------------
363 -- Writes a Serpent Keyset to the given RSA Message
364 --
365 -- Keyset - the set of keys to write to message
366 -- Counter - the message count
367 procedure Write_SKeys_RMsg( Keyset : in Serpent_Keyset;
368 Counter : in Interfaces.Unsigned_16;
369 Msg : out Raw_Types.RSA_Msg);
370
371 -- Reads a Serpent Keyset from the given RSA Message
372 -- The opposite of Write_SKeys_RMsg above
373 -- Raises Invalid_Message exception if given message fails sanity checks
374 procedure Read_SKeys_RMsg( Msg : in Raw_Types.RSA_Msg;
375 Counter : out Interfaces.Unsigned_16;
376 Keyset : out Serpent_Keyset);
377
378 ------------------------Keys Management------------------------------
379 -- Writes a Key Management structure to the given RSA Message
380 --
381 -- KMgm - the keys management structure to write to message
382 -- Counter - the message count
383 procedure Write_KMgm_RMsg( KMgm : in Keys_Mgm;
384 Counter : in Interfaces.Unsigned_16;
385 Msg : out Raw_Types.RSA_Msg);
386
387 -- Reads a Key management structure from the given RSA Message
388 -- The opposite of Write_KMgm_SMsg above
389 -- Raises Invalid_Message exception if given message fails sanity checks
390 procedure Read_KMgm_RMsg( Msg : in Raw_Types.RSA_Msg;
391 Counter : out Interfaces.Unsigned_16;
392 KMgm : out Keys_Mgm);
393
394
395 private
396
397 -- if native is little endian, does nothing;
(74 . 4)(133 . 35)
399 Move_A_Type : constant Interfaces.Unsigned_8 := 6;
400 Train_A_Type : constant Interfaces.Unsigned_8 := 7;
401
402 -- internal read/write of Serpent Keys
403 -- those are called by both interface methods for RSA and Serpent messages
404
405 -- NB: caller HAS TO provide ENOUGH space in Msg AND valid Type_ID
406 -- Msg will be padded with random octets until full length.
407 procedure Write_SKeys( Keyset : in Serpent_Keyset;
408 Counter : in Interfaces.Unsigned_16;
409 Type_ID : in Interfaces.Unsigned_8;
410 Msg : out Raw_Types.Octets);
411
412 -- NB: caller has to ensure that Msg is a valid RSA or Serpent message
413 procedure Read_SKeys( Msg : in Raw_Types.Octets;
414 Counter : out Interfaces.Unsigned_16;
415 Keyset : out Serpent_Keyset);
416
417
418 -- internal read/write of Key Management structures
419 -- those are called by both interface methods for RSA and Serpent messages
420
421 -- NB: caller HAS TO provide ENOUGH space in Msg AND valid Type_ID
422 -- Msg will be padded with random octets until full length.
423 procedure Write_KMgm( KMgm : in Keys_Mgm;
424 Counter : in Interfaces.Unsigned_16;
425 Type_ID : in Interfaces.Unsigned_8;
426 Msg : out Raw_Types.Octets);
427
428 -- NB: caller has to ensure that Msg is a valid RSA or Serpent message
429 procedure Read_KMgm( Msg : in Raw_Types.Octets;
430 Counter : out Interfaces.Unsigned_16;
431 KMgm : out Keys_Mgm);
432
433 end Messages;
- 0B7D9C9BA8094D32022CAFC676276DDF492FC26965DDAE35CB67DDDFC906B95B5D9025896BAE70ED46A1C6FFD8999D87C707A1EDB5577E5751FC48272108C8DD
+ 108527AA9877FD1AA76FDF913C50760854260B8406DB12A4C7B1A1A052D593EACC2D59D8F36F7BF70BDC6AC21A3A28E80930C89A64020AE597B67976100F61E2
smg_comms/tests/test_serializing.adb
(12 . 14)(12 . 17)
438 package body Test_Serializing is
439
440 procedure Serialize_Keyset_SS is
441 Msg : Serpent_Msg;
442 KSet : Serpent_Keyset(5);
443 LSB : Interfaces.Unsigned_8 := 16#01#;
444 MSB : Interfaces.Unsigned_8 := 16#80#;
445 LMSB: Interfaces.Unsigned_8 := 16#81#;
446 Counter : Interfaces.Unsigned_16 := 101;
447 NewSet: Serpent_Keyset;
448 NewCounter: Interfaces.Unsigned_16:=0;
449 Msg : Serpent_Msg;
450 RMsg : RSA_Msg;
451 KSet : Serpent_Keyset(5);
452 LSB : Interfaces.Unsigned_8 := 16#01#;
453 MSB : Interfaces.Unsigned_8 := 16#80#;
454 LMSB : Interfaces.Unsigned_8 := 16#81#;
455 Counter : Interfaces.Unsigned_16 := 101;
456 NewSetS : Serpent_Keyset;
457 NewSetR : Serpent_Keyset;
458 NewCounterR: Interfaces.Unsigned_16:=0;
459 NewCounterS: Interfaces.Unsigned_16:=0;
460 begin
461 Put_Line("Generating the Serpent Keys...");
462 -- fill a set of Serpent Keys
(28 . 17)(31 . 20)
464 end loop;
465 KSet.Flag := LSB;
466
467 Put_Line("Writing the keys to message...");
468 -- write keyset to serpent message
469 Put_Line("Writing the keys to messages...");
470 -- write keyset to serpent & rsa messages
471 Write_SKeys_SMsg( KSet, Counter, Msg );
472 Write_SKeys_RMsg( KSet, Counter, RMsg );
473
474 Put_Line("Reading keys back from message...");
475 -- read keyset from message
476 Read_SKeys_SMsg( Msg, Counter, NewSet );
477 Put_Line("Reading keys back from messages...");
478 -- read keyset from serpent and rsa messages
479 Read_SKeys_SMsg( Msg, NewCounterS, NewSetS );
480 Read_SKeys_RMsg( RMsg, NewCounterR, NewSetR );
481
482 Put_Line("Comparing the keysets...");
483 -- compare the two keysets
484 if NewSet /= KSet then
485 if NewCounterS /= Counter or NewCounterS /= Counter or
486 NewSetS /= KSet or NewSetR /= KSet then
487 Put_Line("FAIL: keysets are different!");
488 else
489 Put_Line("PASS: keysets are the same!");
(47 . 7)(53 . 7)
491 Put_Line("Attempting to read from mangled message");
492 begin
493 Msg(Msg'First) := Msg(Msg'First)+25;
494 Read_SKeys_SMsg( Msg, Counter, NewSet);
495 Read_SKeys_SMsg( Msg, Counter, NewSetS);
496 Put_Line("FAIL: read failed to raise invalid message exception!");
497 exception
498 when Invalid_Msg =>
(55 . 5)(61 . 74)
500 end;
501 end Serialize_Keyset_SS;
502
503 procedure Serialize_Keys_Mgm is
504 N_Burnt : Counter_8bits;
505 Counter : Interfaces.Unsigned_16 := 16#EDA9#;
506 Mgm_S : Keys_Mgm;
507 Mgm_R : Keys_Mgm;
508 Cnt_S : Interfaces.Unsigned_16:=0;
509 Cnt_R : Interfaces.Unsigned_16:=0;
510 O1 : Octets_1;
511 SMsg : Serpent_Msg;
512 RMsg : RSA_Msg;
513 begin
514 -- fill the struct with random stuff
515 RNG.Get_Octets( O1 );
516 N_Burnt := Cast(O1);
517 declare
518 Mgm: Keys_Mgm(N_Burnt);
519 begin
520 RNG.Get_Octets( O1 );
521 Mgm.N_Server := O1(O1'First);
522 RNG.Get_Octets( O1 );
523 Mgm.N_Client := O1(O1'First);
524 RNG.Get_Octets( O1 );
525 Mgm.Key_ID := O1(O1'First);
526 if N_Burnt > 0 then
527 RNG.Get_Octets( Mgm.Burnt );
528 end if;
529 -- write it to Serpent and RSA messages
530 Write_KMgm_SMsg(Mgm, Counter, SMsg);
531 Write_KMgm_RMsg(Mgm, Counter, RMsg);
532
533 -- read it back from Serpent and RSA messages
534 Read_KMgm_SMsg( SMsg, Cnt_S, Mgm_S );
535 Read_KMgm_RMsg( RMsg, Cnt_R, Mgm_R );
536
537 -- check results
538 if Cnt_S /= Counter or
539 Mgm_S.N_Burnt /= Mgm.N_Burnt or
540 Mgm_S /= Mgm then
541 Put_Line("FAIL: read/write key management struct to S msg.");
542 else
543 Put_Line("PASS: read/write key management struct to S msg.");
544 end if;
545
546 if Cnt_R /= Counter or
547 Mgm_R.N_Burnt /= Mgm.N_Burnt or
548 Mgm_R /= Mgm then
549 Put_Line("FAIL: read/write key management struct to R msg.");
550 Put_Line("Cnt_R is " & Unsigned_16'Image(Cnt_R));
551 Put_Line("Counter is " & Unsigned_16'Image(Counter));
552 Put_Line("Mgm_R.N_Burnt is " & Counter_8bits'Image(Mgm_R.N_Burnt));
553 Put_Line("Mgm.N_Burnt is " & Counter_8bits'Image(Mgm.N_Burnt));
554 else
555 Put_Line("PASS: read/write key management struct to R msg.");
556 end if;
557
558 -- attempt mangled call - should raise exception
559 begin
560 SMsg(SMsg'First) := SMsg(SMsg'First) + 1;
561 Read_KMgm_SMsg( SMsg, Cnt_S, Mgm_S);
562 Put_Line("FAIL: Read_KMgm_SMsg failed to raise exception!");
563 exception
564 when Invalid_Msg =>
565 Put_Line("PASS: Read_KMgm_SMsg correctly raised exception.");
566 end;
567
568 end;
569
570 end Serialize_Keys_Mgm;
571
572 end Test_Serializing;
573
- 0571DD3EA06E4684EFB6CA56739FE9FF7F56BEFEF87C107AA38F356772338418AFB8562F989C615FF9D9B10CFA95CDB57BF88A395524ADB6194E62BD66812637
+ E6F805434755B87ED7E265A405C3A505498AB7D154C47206DC3A7EC980EE58FD3DF2AF9DF762EA764F82DD59C7AC90F99F61E48B1B99A88D38762C497F816572
smg_comms/tests/test_serializing.ads
(6 . 6)(6 . 7)
578 package Test_Serializing is
579
580 procedure Serialize_Keyset_SS;
581 procedure Serialize_Keys_Mgm;
582
583 private
584
- C0A18FD4B745715568D7EF048D6D39F9E161B859D781CDAF1BA656CD327407F11CA302B1E1F58BC6A5D17DE14B871F577C151BFD17C6BA560B1A6F111F4021FC
+ 117663918D15B926ACF72A7AE5E3736AAB93B06A12148422D9A74DE147FB6E6F66961282CEC214A9F946E778DB1129BFDF14B184E63B84DF86E54A07312DF35A
smg_comms/tests/testall.adb
(15 . 4)(15 . 5)
589 Test_Packing.Test_Pack_Unpack_Serpent;
590 Test_Packing.Test_Pack_Unpack_RSA;
591 Test_Serializing.Serialize_Keyset_SS;
592 Test_Serializing.Serialize_Keys_Mgm;
593 end testall;