CryptX

 view release on metacpan or  search on metacpan

src/ltc/misc/ssh/ssh_decode_sequence_multi.c  view on Meta::CPAN

  @param inlen  [in/out] The length of the input buffer and on output the amount of decoded data
  @remark <...> is of the form <type, data*> (int, <unsigned char*,ulong32*,ulong64*>) except for string&name-list <type, data, size*> (int, void*, unsigned long*)
  @return CRYPT_OK on success
*/
int ssh_decode_sequence_multi(const unsigned char *in, unsigned long *inlen, ...)
{
   int           err;
   va_list       args;
   ssh_data_type type;
   void          *vdata;
   unsigned char *cdata;
   char          *sdata;
   ulong32       *u32data;
   ulong64       *u64data;
   unsigned long *bufsize;
   ulong32       size;
   unsigned long remaining;

   LTC_ARGCHK(in    != NULL);
   LTC_ARGCHK(inlen != NULL);

src/ltc/misc/ssh/ssh_decode_sequence_multi.c  view on Meta::CPAN


      vdata = va_arg(args, void*);
      if (vdata == NULL) {
         err = CRYPT_INVALID_ARG;
         goto error;
      }

      /* Read data */
      switch (type) {
         case LTC_SSHDATA_BYTE:
            cdata = vdata;
            *cdata = *in++;
            break;
         case LTC_SSHDATA_BOOLEAN:
            cdata = vdata;
            /*
               The value 0 represents FALSE, and the value 1 represents TRUE.  All non-zero values MUST be
               interpreted as TRUE; however, applications MUST NOT store values other than 0 and 1.
             */
            *cdata = (*in++)?1:0;
            break;
         case LTC_SSHDATA_UINT32:
            u32data = vdata;
            LOAD32H(*u32data, in);
            in += 4;
            break;
         case LTC_SSHDATA_UINT64:
            u64data = vdata;
            LOAD64H(*u64data, in);
            in += 8;



( run in 0.752 second using v1.01-cache-2.11-cpan-454fe037f31 )