first step of v2 final release

This commit is contained in:
Zhi Guan
2017-11-05 21:00:36 +08:00
parent 480b9e8d88
commit 27bde477a5
395 changed files with 26341 additions and 31364 deletions

View File

@@ -1,5 +1,5 @@
/* ====================================================================
* Copyright (c) 2016 The GmSSL Project. All rights reserved.
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,11 +47,11 @@
* ====================================================================
*/
#ifndef HEADER_SDF_METH_H
#define HEADER_SDF_METH_H
#ifndef HEADER_SDF_INT_H
#define HEADER_SDF_INT_H
#include <openssl/sgd.h>
#include <openssl/sdf.h>
#include <openssl/gmsdf.h>
#include "internal/dso.h"
@@ -359,13 +359,13 @@ typedef int (*SDF_HashFinal_FuncPtr)(void *hSessionHandle,
unsigned char *pucHash,
unsigned int *puiHashLength);
typedef int (*SDF_CreateFile_FuncPtr)(
typedef int (*SDF_CreateObject_FuncPtr)(
void *hSessionHandle,
unsigned char *pucFileName,
unsigned int uiNameLen,
unsigned int uiFileSize);
typedef int (*SDF_ReadFile_FuncPtr)(
typedef int (*SDF_ReadObject_FuncPtr)(
void *hSessionHandle,
unsigned char *pucFileName,
unsigned int uiNameLen,
@@ -373,7 +373,7 @@ typedef int (*SDF_ReadFile_FuncPtr)(
unsigned int *puiReadLength,
unsigned char *pucBuffer);
typedef int (*SDF_WriteFile_FuncPtr)(
typedef int (*SDF_WriteObject_FuncPtr)(
void *hSessionHandle,
unsigned char *pucFileName,
unsigned int uiNameLen,
@@ -381,13 +381,14 @@ typedef int (*SDF_WriteFile_FuncPtr)(
unsigned int uiWriteLength,
unsigned char *pucBuffer);
typedef int (*SDF_DeleteFile_FuncPtr)(
typedef int (*SDF_DeleteObject_FuncPtr)(
void *hSessionHandle,
unsigned char *pucFileName,
unsigned int uiNameLen);
typedef struct sdf_method_st {
char *name;
DSO *dso;
SDF_OpenDevice_FuncPtr OpenDevice;
SDF_CloseDevice_FuncPtr CloseDevice;
SDF_OpenSession_FuncPtr OpenSession;
@@ -432,12 +433,32 @@ typedef struct sdf_method_st {
SDF_HashInit_FuncPtr HashInit;
SDF_HashUpdate_FuncPtr HashUpdate;
SDF_HashFinal_FuncPtr HashFinal;
SDF_CreateFile_FuncPtr CreateFileObject;
SDF_ReadFile_FuncPtr ReadFileObject;
SDF_WriteFile_FuncPtr WriteFileObject;
SDF_DeleteFile_FuncPtr DeleteFileObject;
SDF_CreateObject_FuncPtr CreateObject;
SDF_ReadObject_FuncPtr ReadObject;
SDF_WriteObject_FuncPtr WriteObject;
SDF_DeleteObject_FuncPtr DeleteObject;
} SDF_METHOD;
SDF_METHOD *SDF_METHOD_load_library(const char *so_path);
void SDF_METHOD_free(SDF_METHOD *meth);
typedef struct sdf_vendor_st {
char *name;
unsigned int (*get_cipher_algor)(unsigned int vendor_id);
unsigned int (*get_digest_algor)(unsigned int vendor_id);
unsigned int (*get_pkey_algor)(unsigned int vendor_id);
unsigned int (*get_cipher_cap)(unsigned int vendor_cap);
unsigned int (*get_digest_cap)(unsigned int vendor_cap);
unsigned int (*get_pkey_cap)(unsigned int vendor_cap);
int (*encode_ecccipher)(const ECCCipher *a, void *buf);
int (*decode_ecccipher)(ECCCipher *a, const void *buf);
unsigned long (*get_error_reason)(int err);
} SDF_VENDOR;
typedef struct {
int err;
unsigned long reason;
} SDF_ERR_REASON;
#endif

File diff suppressed because it is too large Load Diff