#include <sys/mman.h>
#include <unistd.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <openssl/rand.h>
#include <uuid/uuid.h>
#include "lcg_util.h"
#include "ss-util.h"
#include "keystore_client.h"
Go to the source code of this file.
Functions | |
void | ivec_inc (unsigned char *counter) |
void | ivec_dec (unsigned char *counter) |
void | securestorage_AES_ctr (const unsigned char *in, unsigned char *out, const unsigned long length, const AES_KEY *key, unsigned char ivec[16], unsigned char ecount_buf[16], unsigned int *num) |
Encrypt input string using AES_ctr algorithm. | |
size_t | lock_memory (char *addr, size_t size) |
size_t | unlock_memory (char *addr, size_t size) |
int | ss_rand (int size, unsigned char *out) |
Generate random data function. | |
int | ss_generate_surl (char **dest_surl, char *dest_file, char *vo, char *guid) |
Generate SURL. | |
int | ss_get_lfchome (const char *input_lfn, char **lfn_new) |
Get LFC Home. | |
int | ss_get_surl (char *lfn, char **surl, char *vo, char *se, int insecure) |
Get SURL. | |
int | ss_check_lfn (char *lfn, char *vo) |
Check LFN existence. | |
const char * | securestorage_error (int errnum) |
Return descriptive string of error. | |
Variables | |
int | securestorage_nerr = 56 |
int | errno |
Definition in file ss-util.c.
|
decrement counter (128-bit int) by 1.
Definition at line 136 of file ss-util.c. References GETU32, and PUTU32. Referenced by securestorage_lseek(). |
|
increment counter (128-bit int) by 1.
Definition at line 97 of file ss-util.c. References GETU32, and PUTU32. Referenced by securestorage_AES_ctr(), and securestorage_lseek(). |
|
Lock memory.
|
|
Encrypt input string using AES_ctr algorithm. The input encrypted as though 128bit counter mode is being used. The extra state information to record how much of the 128bit block we have used is contained in *num, and the encrypted counter is kept in ecount_buf. Both *num and ecount_buf must be initialised with zeros before the first call to securestorage_AES_ctr(). This algorithm assumes that the counter is in the x lower bits of the IV (ivec), and that the application has full control over overflow and the rest of the IV. This implementation takes NO responsability for checking that the counter doesn't overflow into the rest of the IV when incremented.
Definition at line 193 of file ss-util.c. References AES_BLOCK_SIZE, AES_encrypt(), AES_KEY, and ivec_inc(). Referenced by lcg_scp(), lcg_scr(), securestorage_read(), and securestorage_write(). |
|
Return descriptive string of error. for errnum provided
Definition at line 547 of file ss-util.c. References ss_errlist. |
|
Check LFN existence. This function check if provided lfn exist in LFC Catalog
Definition at line 504 of file ss-util.c. References errno, and insecure. Referenced by lcg_scr(), lcg_sdel(), securestorage_del_extended(), and securestorage_open_extended(). |
|
Generate SURL. This function generate a valid SURL ( in srm:// format ).
Definition at line 293 of file ss-util.c. References errno. Referenced by lcg_scr(), and securestorage_open_extended(). |
|
Get LFC Home. This function add LFC_HOME To your current LFN.
Definition at line 363 of file ss-util.c. References LCG_MAXPATHLEN. Referenced by lcg_scp(), lcg_scr(), lcg_sdel(), securestorage_del_extended(), securestorage_mkdir(), securestorage_open_extended(), securestorage_opendir(), securestorage_rmdir(), and securestorage_statg(). |
|
Get SURL. This function get the SURL for the input LFN given.
Definition at line 438 of file ss-util.c. References errno, insecure, and SS_ENOENT. Referenced by lcg_scp(), and securestorage_open_extended(). |
|
Generate random data function. This function generate random data for the specified size, for using it on encryption process.
Definition at line 252 of file ss-util.c. References errno. Referenced by lcg_scr(), and securestorage_open_extended(). |
|
Unlock memory.
|
|
|
|
|