当前位置:首页>Linux>Linux用户程序使用内核加密服务的方法

Linux用户程序使用内核加密服务的方法

  • 2026-02-05 18:48:48
Linux用户程序使用内核加密服务的方法

概述

在Linux用户空间,如果要进行加解密运算,通常的方法是安装类似OpenSSL的软件。但是这些加解密运算可以卸载使用内核空间的加密服务,尤其是内核适配了硬件引擎驱动,能有效降低CPU运算负载。

应用层访问内核加密服务大致有如下四种方式:

  • AF_ALG
  • libkcap
  • cryptodev-linux
  • openssl engine

下图是以OpenSSL为例,展示了用户空间到内核空间的加密服务调用路径:

Linux加密子系统分层框架

接下来我们在RISCV开发板上测试四种方法,所有的程序和库需要使用交叉编译。

AF_ALG

AF_ALG是Linux内核提供的一种特殊套接字接口,实现用户空间程序与内核加密API进行通信,为用户态提供相应的加解密服务。

应用层在使用内核加密服务之前,必须配置内核开启相应用户接口选项,如下使能哈希和对称加密的用户API配置:

CONFIG_CRYPTO_USER=yCONFIG_CRYPTO_USER_API_HASH=yCONFIG_CRYPTO_USER_API_SKCIPHER=y

编写sha256计算示例代码如下:

#include<stdio.h>#include<stdlib.h>s#include<string.h>#include<unistd.h>#include<sys/socket.h>#include<linux/if_alg.h>#include<linux/socket.h>intmain(void){int tfmfd, opfd;// 绑定算法类型和名称structsockaddr_algsa = {        .salg_family = AF_ALG,        .salg_type = "hash",       // 算法类型:哈希        .salg_name = "sha256"// 具体算法:SHA256    };constchar *msg = "Hello World";size_t msg_len = strlen(msg);unsignedchar dgst[32];ssize_t len;// 创建AF_ALG套接字    tfmfd = socket(AF_ALG, SOCK_SEQPACKET, 0);if (tfmfd < 0) {        perror("socket");exit(EXIT_FAILURE);    }// 绑定算法类型和名称if (bind(tfmfd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {        perror("bind");        close(tfmfd);exit(EXIT_FAILURE);    }// 获取操作句柄    opfd = accept(tfmfd, NULL0);if (opfd < 0) {        perror("accept");        close(tfmfd);exit(EXIT_FAILURE);    }// 发送数据到内核进行哈希计算if (send(opfd, msg, msg_len, 0) != msg_len) {        perror("send");        close(opfd);        close(tfmfd);exit(EXIT_FAILURE);    }// 获取哈希结果    len = read(opfd, dgst, sizeof(dgst));if (len != sizeof(dgst)) {        perror("read");        close(opfd);        close(tfmfd);exit(EXIT_FAILURE);    }// 打印结果printf("Input: %s\nSHA256: ", msg);for (int i = 0; i < sizeof(dgst); i++) {printf("%02x", dgst[i]);    }printf("\n");// 清理资源    close(opfd);    close(tfmfd);return0;}

使用交叉工具链编译,并在开发板上执行,输出如下:

$ ./af_alg_sha256 Input: Hello WorldSHA256: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

默认情况下,会使用内核软件实现的方式计算哈希。如果加载了引擎驱动,就会调用硬件进行计算,但需要注意在注册该算法SHA256时,不能开启此标志CRYPTO_ALG_INTERNAL,即允许应用层调用该算法。硬件引擎驱动安装方法如下(后续其他方式想使用硬件引擎,都需要先安装驱动模块):

$ insmod crypto_engine.ko$ insmod demo_crypto.ko

同样AES-CTR-128算法的计算示例如下,需要注意明文数据长度要16字节块对齐。

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<sys/socket.h>#include<linux/if_alg.h>#include<linux/socket.h>#ifndef SOL_ALG#define SOL_ALG 279#endifintmain(void){int tfmfd, opfd;// 绑定算法类型和名称structsockaddr_algsa = {        .salg_family = AF_ALG,        .salg_type = "skcipher",      // 算法类型:加密        .salg_name = "ctr(aes)"// 具体算法:AES-CTR    };constchar *plaintext = "Hello World!!!!!";size_t plaintext_len = strlen(plaintext);constunsignedchar key[16] = {0x000x110x220x330x440x550x660x77,0x880x990xaa0xbb0xcc0xdd0xee0xff    };constunsignedchar iv[16] = {0x000x110x220x330x440x550x660x77,0x880x990xaa0xbb0xcc0xdd0xee0xff    };structmsghdrmsg = {};structcmsghdr *cmsg;char cbuf[CMSG_SPACE(4) + CMSG_SPACE(20)] = {0};structaf_alg_iv *af_alg_iv;structioveciov;unsignedchar buf[16];// 创建AF_ALG套接字    tfmfd = socket(AF_ALG, SOCK_SEQPACKET, 0);if (tfmfd < 0) {        perror("socket");exit(EXIT_FAILURE);    }// 绑定算法类型和名称if (bind(tfmfd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {        perror("bind");        close(tfmfd);exit(EXIT_FAILURE);    }// 配置密钥if (setsockopt(tfmfd, SOL_ALG, ALG_SET_KEY, key, sizeof(key)) < 0) {        perror("setsockopt");        close(tfmfd);exit(EXIT_FAILURE);    }// 获取操作句柄    opfd = accept(tfmfd, NULL0);if (opfd < 0) {        perror("accept");        close(tfmfd);exit(EXIT_FAILURE);    }// 配置操作和IV,并发送数据到内核进行加密计算    msg.msg_control = cbuf;    msg.msg_controllen = sizeof(cbuf);// 操作    cmsg = CMSG_FIRSTHDR(&msg);    cmsg->cmsg_level = SOL_ALG;    cmsg->cmsg_type = ALG_SET_OP;    cmsg->cmsg_len = CMSG_LEN(4);    *(unsignedint *)CMSG_DATA(cmsg) = ALG_OP_ENCRYPT;// IV    cmsg = CMSG_NXTHDR(&msg, cmsg);    cmsg->cmsg_level = SOL_ALG;    cmsg->cmsg_type = ALG_SET_IV;    cmsg->cmsg_len = CMSG_LEN(20);    af_alg_iv = (struct af_alg_iv *)CMSG_DATA(cmsg);memcpy(af_alg_iv->iv, iv, 16);    af_alg_iv->ivlen = 16;// 数据    iov.iov_base = (void *)plaintext;    iov.iov_len = plaintext_len;    msg.msg_iov = &iov;    msg.msg_iovlen = 1;// 发送数据到内核进行计算if (sendmsg(opfd, &msg, 0) < 0) {        perror("sendmsg");        close(opfd);        close(tfmfd);exit(EXIT_FAILURE);    }// 获取加密结果if (read(opfd, buf, sizeof(buf)) < 0) {        perror("read");        close(opfd);        close(tfmfd);exit(EXIT_FAILURE);    }// 打印结果printf("Input: %s\nAES-CTR-128 Output: ", plaintext);for (int i = 0; i < sizeof(buf); i++) {printf("%02x", buf[i]);    }printf("\n");// 清理资源    close(opfd);    close(tfmfd);return0;}

同样使用交叉工具链编译,并在开发板上执行,输出如下:

$ ./af_alg_aes-ctr-128 Input: Hello World!!!!!AES-CTR-128 Output: 2a9315d244d08e5e167267bd82613a93

而对于非对称算法,比如rsa算法在Linux主分支中未支持通过af_alg方式调用,但是在kernel-patchs目录提供了补丁,可以自行添加到内核中。

libkcapi

库libkcapi 允许用户空间访问Linux内核crypto API。该库利用Netlink接口并封装出易于使用的API,使开发者无需关注底层Netlink接口的处理细节。该库本身不实现任何加密算法,所有消费者请求均发送至内核进行处理。内核加密API的返回结果通过相关API回传给消费者。

下载并编译,流程如下:

$ git clone  https://github.com/smuellerDD/libkcapi cd libkcapi$ autoreconf -i$ ./configure --prefix=/path/to/libkcapi/install --enable-kcapi-test CC=/path/to/riscv32-linux-gcc --host=riscv$ make all && make install
  • --prefix:指定库和应用的安装目录
  • --enable-kcapi-test:编译测试程序
  • CC:指定编译器
  • --host:主机平台

编译成功后库和应用程序在libkcapi/install目录下,拷贝到开发板上。

测试sha256哈希计算命令如下:

$ ./kcapi -x 3 -c "sha256" -p 48656c6c6f20576f726c64a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

测试aes-ctr加密命令如下:

$ ./kcapi -x 1 -e -c "ctr(aes)" -k 00112233445566778899aabbccddeeff  -i 00112233445566778899aabbccddeeff -p 48656c6c6f20576f726c6421212121212a9315d244d08e5e167267bd82613a93

如果运行时报如下错误libkcapi - Error: Netlink error: cannot open netlink socket,注意Linux配置需要开启CONFIG_CRYPTO_USER选项,并重新编译内核。

由于AF_ALG不支持非对称算法,如果自行安装了补丁,也可以使用libkcapi测试非对称算法,注意需要使能—enable-lib-asym选项,并重新编译。测试rsa私钥加密命令如下:

$ ./kcapi -x 4 -o 0 -c "rsa" -r 3082010902820100DB101AC2A3F1DCFF136BED44DFF0026D13C788DA706B54F1E827DCC30F996AFAC667FF1D1E3C1DC1B55F6CC0B2073A6D41E42599ACFCD20F02D3D154061A5177BDB6BFEAA75C06A95D698445D7F505BA47F01BD72B24ECCB9B1B108D81A0BEB18C33E436B843EB192A818DDE810A9948B6F6BCCD49343A8F2694E328821A7C8F599F45E85D1A4576045605A1D01B8C776DAF53FA71E267E09AFE03A985D2C9AABA2ABCF4A008F51398135DF0D933342A61C38955F0AE1A9C22EE19058D32FEEC9C84BAB7F96C3A4F07FC45EB12E57BFD55E62969D1C2E8B97859F67910C64EEB6A5EB99AC7C45B63DAA33F5E927A815ED6B0E2628F7426C20CD39A1747E68EAB0203010001 -p 54859b342c49ea2ab29776b4ae3e383c7e641fcca27ff6becf49bc48d36c8f0a0ec173bd7b5579360ea18788b92c90a6535ee9efc4e24dddf7a669823f56a47bfb62e0aeb8d304b3ac5a152ae3199b039a0b41da64ec0a69fcf21092f3c1bf847ffd2caec8b5f64170c547038af8ff6f3fd26f09b422f330bea985cb9c8df98feb3291a225848ff5dcc7069c2de5112c09098709a9f6337390f160f265dd30a566ce627bd0f82d3d198277e30a5f752f8eb1e5e891351b3b33b76692d1f28e6fe5750cad36fb4ed06661bd49fef41aa22b49fe034c74478d9a66b249464d77ea33

cryptodev-linux

cryptodev-linux 是一个/dev/crypto设备驱动,也允许用户空间调用内核的加密API。下载和编译流程如下:

# 下载源码git clone https://github.com/cryptodev-linux/cryptodev-linux# 配置交叉编译器export CROSS_COMPILE=/path/to/riscv32-linux-export CC=${CROSS_COMPILE}gccexport LD=${CROSS_COMPILE}ld# 配置架构export ARCH=riscv# 配置内核源码的编译目录export KERNEL_DIR=/path/to/linux-build# 编译$ make# 编译测试程序$ make tests

这里注意要配置内核源码的编译目录KERNEL_DIR

编译成功会在根目录下生成cryptodev.kocryptode-linux也提供了一些示例,位于examples目录,这里编译哈希和加密代码,测试一下功能正确性:

cd examples$ {CROSS_COMPILE}gcc sha.c -o sha -I../$ {CROSS_COMPILE}gcc aes.c -o aes -I../

将以上编译的输出文件cryptodev.koshaaes拷贝到设备上,执行查看哈希和加解密功能是否正常:

$ insmod cryptodev.ko$ ./shaGot sha1 with driver sha1-genericNote: This is not an accelerated cipher$ ./aesGot cbc(aes) with driver cbc(aes-generic)Note: This is not an accelerated cipherGot cbc(aes) with driver cbc(aes-generic)Note: This is not an accelerated cipherAES Test passed

可以看出功能pass,但是并未使用加速引擎。如果我们安装了硬件驱动引擎模块,就会调用硬件引擎计算。

$ insmod crypto_engine.ko$ insmod demo_crypto.ko$ ./aesGot cbc(aes) with driver cbc(aes)-acmeGot cbc(aes) with driver cbc(aes)-acmeAES Test passed

openssl engine

OpenSSL支持动态引擎,可以通过af_algcryptodev等方式卸载加解密请求到内核。

下载OpenSSL并进行编译,命令如下:

$ wget https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz$ tar -xvf openssl-3.4.0.tar.gz && cd openssl-3.4.0$ ./Configure --prefix=$(pwd)/install --cross-compile-prefix=/path/to/riscv32-linux- linux32-riscv32$ make -j12 && make install
  • --prefix:指定库和应用的安装目录
  • --cross-compile-prefix:指定交叉编译器
  • linux32-riscv32:主机平台

编译成功后命令程序和动态库文件位于install目录,拷贝到目标开发板上:

$ cp openssl-3.4.0/install/lib/libcrypto.so.3 /usr/lib$ cp openssl-3.4.0/install/lib/libssl.so.3 /usr/lib$ cp openssl-3.4.0/install/bin/openssl /usr/bin

OpenSSL默认编译是支持动态引擎加载,因此执行如下命令,可以看到响应:

$ openssl engine -c(dynamic) Dynamic engine loading support

af_alg方式

首先看下af_alg方式卸载到内核,OpenSSL默认编译自带af_alg,生成的引擎so文件位于openssl-3.4.0/install/l ib64/engines-3/afalg.so。同样拷贝到目标开发板上:

$ cp openssl-3.4.0/install/lib64/engines-3/afalg.so /usr/lib

注意需要配置OPENSSL_ENGINES环境变量,否则找不到afalg.so动态库:

export OPENSSL_ENGINES=/usr/lib

查看引擎是否安装成功,并列举支持的算法能力,当前只支持AES-CBC算法:

$ openssl engine -c -t afalg(afalg) AFALG engine support [AES-128-CBC, AES-192-CBC, AES-256-CBC]     [ available ]

测试一下加解密,查看引擎是否正常工作:

# 纯应用层软件加密$ openssl enc -e -aes-128-cbc -K 00112233445566778899aabbccddeeff -iv 00112233445566778899aabbccddeeff -in hello.txt -out ciphertext# 启用afalg引擎加密$ openssl enc -e -aes-128-cbc -K 00112233445566778899aabbccddeeff -iv 00112233445566778899aabbccddeeff -in hello.txt -out ciphertext_afalg -engine afalgEngine "afalg"set.

我们也可以手动动态加载AF_ALG,命令如下:

$ openssl engine -t -c -pre SO_PATH:/usr/lib/afalg.so -pre ID:afalg -pre LOAD

cryptodev方式

接着看下cryptodev方式,默认OpenSSL不编译,因此需要重新编译并使能enable-devcryptoeng,另外注意需要提供cryptodev-linux的头文件目录:

$ ./Configure --prefix=$(pwd)/install --cross-compile-prefix=/path/to/riscv32-linux- linux32-riscv32 -I/path/to/cryptodev-linux enable-devcryptoeng$ make -j12 && make install

生成的引擎so文件位于openssl-3.4.0/install/l ib64/engines-3/devcrypto.so。同样拷贝到目标开发板上:

cp openssl-3.4.0/install/lib64/engines-3/devcrypto.so /usr/lib

由于openssl编译出的引擎依赖cryptodev库,因此需要先安装前一章cryptodev-linux编译出的cryptodev.ko

$ insmod cryptodev.ko

否则直接使用devcyrpto方式,会报错:

90AF7595:error:1300006D:engine routines:dynamic_load:init failed:crypto/engine/eng_dyn.c:510:90AF7595:error:13000074:engine routines:ENGINE_by_id:no such engine:crypto/engine/eng_list.c:475:id=devcrypto

同样查看引擎是否安装成功,并列举支持的算法能力,可以看出支持AES-CBC/CTR和SHA256算法,比af_alg方式多:

$ openssl engine -c -t devcrypto(devcrypto) /dev/crypto engine [AES-128-CBC, AES-192-CBC, AES-256-CBC, AES-128-CTR, AES-192-CTR, AES-256-CTR, AES-128-ECB, AES-192-ECB, AES-256-ECB, SHA256]     [ available ]

测试一下SHA256算法,查看引擎是否正常工作:

# 纯应用层软件计算$ openssl dgst -sha256 hello.txtSHA2-256(hello.txt)= a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447# 启用devcrypto引擎计算$ openssl dgst -engine devcrypto -sha256 hello.txt Engine "devcrypto"set.SHA2-256(hello.txt)= a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447

再测试一下AES加解密:

# 纯应用层软件加密$ openssl enc -e -aes-128-cbc -K 00112233445566778899aabbccddeeff -iv 00112233445566778899aabbccddeeff -in hello.txt -out ciphertext# 启用devcrypto引擎加密$ openssl enc -e -aes-128-cbc -K 00112233445566778899aabbccddeeff -iv 00112233445566778899aabbccddeeff -in hello.txt -out ciphertext_devcrypto -engine devcryptoEngine "devcrypto"set.

最后再测试一下非对称算法RSA的签名和验签:

# 生成密钥$ openssl genrsa -out prikey.pem 2048# 提取公钥$ openssl rsa -in prikey.pem -pubout -out pubkey.pem# PEM转化为DER格式$ openssl rsa -pubin -in pubkey.pem -out pubkey.der -outform DER# 随机生成32字节哈希$ dd if=/dev/urandom of=hash bs=1 count=32# 纯应用层软件签名$ openssl pkeyutl -sign -inhash -inkey prikey.pem -out sig -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pss# 纯应用层软件验签$ openssl pkeyutl -verify -inhash -sigfile sig -pubin -inkey pubkey.pem -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pssSignature Verified Successfully# 启用devcrypto引擎签名$ openssl pkeyutl -sign -inhash -inkey prikey.pem -out sig -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pss -engine devcryptoEngine "devcrypto"set.# 启用devcrypto引擎验签$ openssl pkeyutl -verify -inhash -sigfile sig -pubin -inkey pubkey.pem -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pss -engine devcryptoEngine "devcrypto"set.Signature Verified Successfully

参考

  1. User Space Interface
  2. OpenSSL初体验
  3. Linux内核学习笔记——Crypto基础框架

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 12:17:09 HTTP/2.0 GET : https://f.mffb.com.cn/a/473707.html
  2. 运行时间 : 0.177835s [ 吞吐率:5.62req/s ] 内存消耗:4,517.61kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=33db5b75aa9711d4d9149851d70dc9ec
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000989s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001367s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.022135s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.006716s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001553s ]
  6. SELECT * FROM `set` [ RunTime:0.000772s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001502s ]
  8. SELECT * FROM `article` WHERE `id` = 473707 LIMIT 1 [ RunTime:0.001038s ]
  9. UPDATE `article` SET `lasttime` = 1770437829 WHERE `id` = 473707 [ RunTime:0.009848s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.002495s ]
  11. SELECT * FROM `article` WHERE `id` < 473707 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.004575s ]
  12. SELECT * FROM `article` WHERE `id` > 473707 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004854s ]
  13. SELECT * FROM `article` WHERE `id` < 473707 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.014774s ]
  14. SELECT * FROM `article` WHERE `id` < 473707 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.006823s ]
  15. SELECT * FROM `article` WHERE `id` < 473707 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.008075s ]
0.182006s