Utility functions for XrdHTTP. More...
#include "XrdHttpUtils.hh"#include <cstring>#include <openssl/hmac.h>#include <openssl/bio.h>#include <openssl/buffer.h>#include <openssl/err.h>#include <openssl/ssl.h>#include "sys/param.h"#include <pthread.h>#include <memory>#include <vector>#include <algorithm>#include "XrdSec/XrdSecEntity.hh"#include "XrdOuc/XrdOucString.hh"Go to the source code of this file.
Functions | |
| void | base64DecodeHex (const std::string &base64, std::string &hexOutput) |
| void | base64ToBytes (const std::string &base64digest, std::vector< uint8_t > &outputBytes) |
| void | bytesToHex (const std::vector< uint8_t > &bytes, std::string &output) |
| void | calcHashes (char *hash, const char *fn, kXR_int16 request, XrdSecEntity *secent, time_t tim, const char *key) |
| static int | char_to_int (int ch) |
| int | compareHash (const char *h1, const char *h2) |
| char * | escapeXML (const char *str) |
| bool | Fromhexdigest (const std::string &hex, std::vector< uint8_t > &outputBytes) |
| std::string | httpStatusToString (int status) |
| std::string | itos (long i) |
| int | mapErrNoToHttp (int errNo) |
| int | mapXrdErrToHttp (XErrorCode xrdError) |
| char * | mystrchrnul (const char *s, int c) |
| char * | quote (const char *str) |
| void | Tobase64 (const std::vector< uint8_t > &input, std::string &base64Output) |
| void | Tobase64 (const unsigned char *input, int length, char *out) |
| char * | unquote (char *str) |
| void base64DecodeHex | ( | const std::string & | base64, |
| std::string & | hexOutput ) |
Definition at line 155 of file XrdHttpUtils.cc.
References base64ToBytes(), and bytesToHex().
Referenced by XrdHttpHeaderUtils::parseReprDigest().
| void base64ToBytes | ( | const std::string & | base64digest, |
| std::vector< uint8_t > & | outputBytes ) |
Definition at line 118 of file XrdHttpUtils.cc.
Referenced by base64DecodeHex().
| void bytesToHex | ( | const std::vector< uint8_t > & | bytes, |
| std::string & | output ) |
Definition at line 145 of file XrdHttpUtils.cc.
Referenced by base64DecodeHex().
| void calcHashes | ( | char * | hash, |
| const char * | fn, | ||
| kXR_int16 | request, | ||
| XrdSecEntity * | secent, | ||
| time_t | tim, | ||
| const char * | key ) |
Definition at line 231 of file XrdHttpUtils.cc.
References XrdSecEntity::host, XrdSecEntity::moninfo, XrdSecEntity::name, Tobase64(), and XrdSecEntity::vorg.
Referenced by XrdHttpProtocol::Process(), and XrdHttpReq::Redir().
|
static |
Definition at line 163 of file XrdHttpUtils.cc.
Referenced by Fromhexdigest().
| int compareHash | ( | const char * | h1, |
| const char * | h2 ) |
Definition at line 367 of file XrdHttpUtils.cc.
Referenced by XrdHttpProtocol::Process().
| char * escapeXML | ( | const char * | str | ) |
Definition at line 473 of file XrdHttpUtils.cc.
Referenced by XrdHttpReq::Error().
| bool Fromhexdigest | ( | const std::string & | hex, |
| std::vector< uint8_t > & | outputBytes ) |
Definition at line 177 of file XrdHttpUtils.cc.
References char_to_int().
| std::string httpStatusToString | ( | int | status | ) |
Definition at line 594 of file XrdHttpUtils.cc.
| std::string itos | ( | long | i | ) |
Definition at line 195 of file XrdHttpUtils.cc.
| int mapErrNoToHttp | ( | int | errNo | ) |
Definition at line 521 of file XrdHttpUtils.cc.
References EAUTH, HTTP_BAD_GATEWAY, HTTP_BAD_REQUEST, HTTP_CONFLICT, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_INSUFFICIENT_STORAGE, HTTP_INTERNAL_SERVER_ERROR, HTTP_LOOP_DETECTED, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_PAYLOAD_TOO_LARGE, HTTP_SERVICE_UNAVAILABLE, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY, and HTTP_URI_TOO_LONG.
Referenced by mapXrdErrToHttp().
| int mapXrdErrToHttp | ( | XErrorCode | xrdError | ) |
Definition at line 514 of file XrdHttpUtils.cc.
References mapErrNoToHttp(), and XProtocol::toErrno().
| char * mystrchrnul | ( | const char * | s, |
| int | c ) |
Definition at line 205 of file XrdHttpUtils.cc.
| char * quote | ( | const char * | str | ) |
Definition at line 414 of file XrdHttpUtils.cc.
Referenced by encode_raw().
| void Tobase64 | ( | const std::vector< uint8_t > & | input, |
| std::string & | base64Output ) |
Definition at line 90 of file XrdHttpUtils.cc.
| void Tobase64 | ( | const unsigned char * | input, |
| int | length, | ||
| char * | out ) |
Definition at line 60 of file XrdHttpUtils.cc.
Referenced by calcHashes().
| char * unquote | ( | char * | str | ) |
Definition at line 382 of file XrdHttpUtils.cc.
Referenced by decode_raw().