- D6C3980DA332629A8C09CFBFB32E1962AD689C7ECBC4A8EE83B02F85C1AA1A3374C5371EEEE7F0CC49FE4C4D8E758F86FA5BA204C5900BD6F4F95CABB3A06EF6
+ 00B24D7C457C5E0A82DFFF5E1E184597D7699ADE009353120910BC18A5577B63291758F88461AAFB79EFCB80065CC8B85F45870F55C29050DD6BFB2F86BCA53C
smg_comms/src/messages.ads
(32 . 6)(32 . 7)
473 -- Counter - the message count
474 procedure Write_SKeys_SMsg( Keyset : in Serpent_Keyset;
475 Counter : in Interfaces.Unsigned_16;
476 Pad : in Raw_Types.Octets_8;
477 Msg : out Raw_Types.Serpent_Msg);
478
479 -- Reads a Serpent Keyset from the given Serpent Message
(48 . 6)(49 . 7)
481 -- Counter - the message count
482 procedure Write_KMgm_SMsg( KMgm : in Keys_Mgm;
483 Counter : in Interfaces.Unsigned_16;
484 Pad : in Raw_Types.Octets_8;
485 Msg : out Raw_Types.Serpent_Msg);
486
487 -- Reads a Key management structure from the given Serpent Message
(61 . 7)(63 . 9)
489
490 -- Writes the given File Chunk to a File Transfer type of message
491 -- Chunk - chunk of file to write; contains counter, filename, content
492 -- Pad - whether random padding (RNG_PAD value) or given value
493 procedure Write_File_Transfer( Chunk : in File_Chunk;
494 Pad : in Raw_Types.Octets_8;
495 Msg : out Raw_Types.Serpent_Msg);
496
497 -- The opposite of Write_File_Transfer method above.
(77 . 6)(81 . 7)
499 -- did not fit into the message and it's up to caller to decide what to do.
500 procedure Write_File_Request( FR : in Filenames;
501 Counter : in Interfaces.Unsigned_16;
502 Pad : in Raw_Types.Octets_8;
503 Msg : out Raw_Types.Serpent_Msg;
504 Written : out Natural);
505
(86 . 17)(91 . 45)
507 Counter : out Interfaces.Unsigned_16;
508 FR : out Filenames);
509
510 -------------------------Client Actions------------------------------
511 -- writes the action (octets+length) into the specified Serpent message
512 procedure Write_Action( A : in Raw_Types.Text_Octets;
513 Counter : in Interfaces.Unsigned_16;
514 Pad : in Raw_Types.Octets_8;
515 Msg : out Raw_Types.Serpent_Msg);
516
517 -- reads a client action as octets+length from the given Serpent message
518 procedure Read_Action( Msg : in Raw_Types.Serpent_Msg;
519 Counter : out Interfaces.Unsigned_16;
520 A : out Raw_Types.Text_Octets);
521
522 ------------------
523 -- RSA Messages --
524 ------------------
525
526 -------------------------Keys----------------------------------------
527
528 -- Writes a RSA Keyset (with 8 octets e) to the given RSA Message.
529 -- K - the Player_RSA structures with all needed information to write
530 -- Counter - the message count
531 procedure Write_RKeys_RMsg( K : in Player_RSA;
532 Counter : in Interfaces.Unsigned_16;
533 Pad : in Raw_Types.Octets_8;
534 Msg : out Raw_Types.RSA_Msg);
535
536 -- Reads a RSA Keyset (Player_RSA structures) from the given RSA Message.
537 -- Opposite of Write_RKeys_RMsg above
538 procedure Read_RKeys_RMsg( Msg : in Raw_Types.RSA_Msg;
539 Counter : out Interfaces.Unsigned_16;
540 K : out Player_RSA);
541
542 -- Writes a Serpent Keyset to the given RSA Message
543 --
544 -- Keyset - the set of keys to write to message
545 -- Counter - the message count
546 procedure Write_SKeys_RMsg( Keyset : in Serpent_Keyset;
547 Counter : in Interfaces.Unsigned_16;
548 Pad : in Raw_Types.Octets_8;
549 Msg : out Raw_Types.RSA_Msg);
550
551 -- Reads a Serpent Keyset from the given RSA Message
(111 . 8)(144 . 10)
553 --
554 -- KMgm - the keys management structure to write to message
555 -- Counter - the message count
556 -- Pad - whether random padding (RNG_PAD) or not.
557 procedure Write_KMgm_RMsg( KMgm : in Keys_Mgm;
558 Counter : in Interfaces.Unsigned_16;
559 Pad : in Raw_Types.Octets_8;
560 Msg : out Raw_Types.RSA_Msg);
561
562 -- Reads a Key management structure from the given RSA Message
(131 . 6)(166 . 10)
564 -- NB: Str'Length has to be EQUAL to Octets'Length!
565 procedure Octets_To_String(O: in Raw_Types.Octets; Str: out String);
566
567 -- magic value used to request random padding
568 RNG_PAD: constant Raw_Types.Octets_8 := ( 16#00#, 16#00#, 16#00#, 16#00#,
569 16#13#, 16#37#, 16#00#, 16#00#);
570
571 private
572
573 -- if native is little endian, does nothing;
(180 . 6)(219 . 7)
575 procedure Write_SKeys( Keyset : in Serpent_Keyset;
576 Counter : in Interfaces.Unsigned_16;
577 Type_ID : in Interfaces.Unsigned_8;
578 Pad : in Raw_Types.Octets_8;
579 Msg : out Raw_Types.Octets);
580
581 -- NB: caller has to ensure that Msg is a valid RSA or Serpent message
(196 . 6)(236 . 7)
583 procedure Write_KMgm( KMgm : in Keys_Mgm;
584 Counter : in Interfaces.Unsigned_16;
585 Type_ID : in Interfaces.Unsigned_8;
586 Pad : in Raw_Types.Octets_8;
587 Msg : out Raw_Types.Octets);
588
589 -- NB: caller has to ensure that Msg is a valid RSA or Serpent message
(223 . 4)(264 . 17)
591 procedure Read_U16( Msg: in Raw_Types.Octets;
592 Pos: in out Natural;
593 U16: out Interfaces.Unsigned_16);
594
595 -- Writes the Counter + padding at the end of messages.
596 -- The padding is either random or repeated value, depending on "Padding".
597 -- NB: This raises Invalid_Msg exception if Pos > Msg'Last - 1
598 -- Msg - the array of octets into which the counter+padding are to be written
599 -- Pos - the position in Msg from which to start writing counter+padding
600 -- Counter - the message counter to write at Pos in Msg.
601 -- Padding - magic value 0x13370000 means random padding;
602 -- - any other value for Padding gets used as it is (repeated)
603 procedure Write_End( Msg : in out Raw_Types.Octets;
604 Pos : in out Natural;
605 Counter : in Interfaces.Unsigned_16;
606 Padding : in Raw_Types.Octets_8);
607 end Messages;