File: Util.h

package info (click to toggle)
barada-pam 0.5-3.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 572 kB
  • sloc: sh: 3,774; cpp: 533; makefile: 83
file content (21 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef __UTIL_H__
#define __UTIL_H__

#include <stdint.h>
#include <security/pam_modules.h>
#include <security/pam_ext.h>
#include <syslog.h>
#include <string>
#include <string.h>

class Util {

 public:
  static void int64ToArrayBigEndian(unsigned char *a, uint64_t i);
  static void int32ToArrayBigEndian(unsigned char *a, uint32_t i);
  static void hexDump(const pam_handle_t *pamh, unsigned char *buf, int length);
  static void hexStringToChar(unsigned char *buffer, int len, std::string &hexString);
  static std::string charToHexString(const unsigned char* buffer, size_t size);
};

#endif