Defines | Functions | Variables
ros_mac_authentication.cpp File Reference

Provides authentication via a message authentication codes (MAC). More...

#include <fstream>
#include <openssl/sha.h>
#include <ros/ros.h>
#include <rosauth/Authentication.h>
#include <sstream>
#include <string>
Include dependency graph for ros_mac_authentication.cpp:

Go to the source code of this file.

Defines

#define FILE_IO_ERROR   -2
#define INVALID_SECRET   -3
#define MISSING_PARAMETER   -1
#define SECRET_FILE_PARAM   "/ros_mac_authentication/secret_file_location"
#define SECRET_LENGTH   16

Functions

bool authenticate (rosauth::Authentication::Request &req, rosauth::Authentication::Response &res)
int main (int argc, char **argv)

Variables

string secret

Detailed Description

Provides authentication via a message authentication codes (MAC).

This node provides a service call that can be used to authenticate a user to use the ROS server. The node relies on a hash string that is made up of several pieces of information and hashed using the SHA-1 algorithm. This node is based on the best-practice method of a message authentication codes (MAC).

Author:
Russell Toris, WPI - rctoris@wpi.edu
Date:
March 4, 2013

Definition in file ros_mac_authentication.cpp.


Define Documentation

#define FILE_IO_ERROR   -2

Error code for an IO error when reading the secret file.

Definition at line 41 of file ros_mac_authentication.cpp.

#define INVALID_SECRET   -3

Error code for an invalid secret string.

Definition at line 47 of file ros_mac_authentication.cpp.

#define MISSING_PARAMETER   -1

Error code for a missing SECRET_FILE_PARAM ROS parameter.

Definition at line 35 of file ros_mac_authentication.cpp.

#define SECRET_FILE_PARAM   "/ros_mac_authentication/secret_file_location"

The ROS parameter name for the file that contains the secret string. We do not store the actual string in the parameter server as the parameter server itself may not be secure.

Definition at line 29 of file ros_mac_authentication.cpp.

#define SECRET_LENGTH   16

Length of the secret string.

Definition at line 53 of file ros_mac_authentication.cpp.


Function Documentation

bool authenticate ( rosauth::Authentication::Request &  req,
rosauth::Authentication::Response &  res 
)

Definition at line 58 of file ros_mac_authentication.cpp.

int main ( int  argc,
char **  argv 
)

Creates and runs the ros_mac_authentication node.

Parameters:
argcargument count that is passed to ros::init
argvarguments that are passed to ros::init
Returns:
EXIT_SUCCESS if the node runs correctly

Definition at line 104 of file ros_mac_authentication.cpp.


Variable Documentation

string secret

Definition at line 56 of file ros_mac_authentication.cpp.



rosauth
Author(s): Russell Toris
autogenerated on Wed Aug 26 2015 16:00:34