Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 理解不透明数据类型_C_Ssl_Types - Fatal编程技术网

C 理解不透明数据类型

C 理解不透明数据类型,c,ssl,types,C,Ssl,Types,在TLS 1.0规范中,提供了在其中使用的类型的说明。这是一个描述的地方: 包含未解释数据的单字节实体属于不透明类型 对我来说,不太清楚什么是未解释的数据。例如,这在以下结构中使用: struct { ConnectionEnd entity; BulkCipherAlgorithm bulk_cipher_algorithm; CipherType cipher_type; uint8 key_s

在TLS 1.0规范中,提供了在其中使用的类型的说明。这是一个描述的地方:

包含未解释数据的单字节实体属于不透明类型

对我来说,不太清楚什么是未解释的数据。例如,这在以下结构中使用:

struct {
  ConnectionEnd          entity;
  BulkCipherAlgorithm    bulk_cipher_algorithm;
  CipherType             cipher_type;
  uint8                  key_size;
  uint8                  key_material_length;
  IsExportable           is_exportable;
  MACAlgorithm           mac_algorithm;
  uint8                  hash_size;
  CompressionMethod      compression_algorithm;
      opaque                 master_secret[48];
      opaque                 client_random[32];
      opaque                 server_random[32];
  } SecurityParameters;

有人可以给我解释一下吗?

他们只是出于文档目的使用了
不透明的
,以强调TLS本身并不解释数据(因为它的含义特定于所使用的密码和哈希函数)。实际上,您可以将不透明的
视为
char
,它保证是一个字节

在包含类似这样的
结构定义的实际实现中,您可能会发现

typedef char opaque;

在它之前的某个地方

unsigned char
uint8\u t
(from),以及它们自己的
uint8
是一些其他的可能性,但这只是一个次要的实现细节。在实践中,这些都可以归结为
char
unsigned char
定义不透明char
变量出现在我的Linux系统上的/usr/include/rpc/key\u prot.h中。)

#define opaque char