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>
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 |
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).
Definition in file ros_mac_authentication.cpp.
#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.
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.
argc | argument count that is passed to ros::init |
argv | arguments that are passed to ros::init |
Definition at line 104 of file ros_mac_authentication.cpp.
string secret |
Definition at line 56 of file ros_mac_authentication.cpp.