Skip to content

Commit

Permalink
unix: add Linux crypto configuration API constants and types
Browse files Browse the repository at this point in the history
Change-Id: I447150cb60b5580cee77d23c0dae2244803e92ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/173660
Run-TryBot: Matt Layher <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
mdlayher committed Apr 24, 2019
1 parent 4347357 commit 18eb32c
Show file tree
Hide file tree
Showing 28 changed files with 2,275 additions and 0 deletions.
76 changes: 76 additions & 0 deletions unix/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ struct termios2 {
#include <linux/net_tstamp.h>
#include <linux/if_xdp.h>
#include <linux/ncsi.h>
#include <linux/cryptouser.h>
// abi/abi.h generated by mkall.go.
#include "abi/abi.h"
Expand Down Expand Up @@ -1754,3 +1755,78 @@ type SockExtendedErr C.struct_sock_extended_err
type FanotifyEventMetadata C.struct_fanotify_event_metadata

type FanotifyResponse C.struct_fanotify_response

// Crypto user configuration API.

const (
CRYPTO_MSG_BASE = C.CRYPTO_MSG_BASE
CRYPTO_MSG_NEWALG = C.CRYPTO_MSG_NEWALG
CRYPTO_MSG_DELALG = C.CRYPTO_MSG_DELALG
CRYPTO_MSG_UPDATEALG = C.CRYPTO_MSG_UPDATEALG
CRYPTO_MSG_GETALG = C.CRYPTO_MSG_GETALG
CRYPTO_MSG_DELRNG = C.CRYPTO_MSG_DELRNG
CRYPTO_MSG_GETSTAT = C.CRYPTO_MSG_GETSTAT
)

const (
CRYPTOCFGA_UNSPEC = C.CRYPTOCFGA_UNSPEC
CRYPTOCFGA_PRIORITY_VAL = C.CRYPTOCFGA_PRIORITY_VAL
CRYPTOCFGA_REPORT_LARVAL = C.CRYPTOCFGA_REPORT_LARVAL
CRYPTOCFGA_REPORT_HASH = C.CRYPTOCFGA_REPORT_HASH
CRYPTOCFGA_REPORT_BLKCIPHER = C.CRYPTOCFGA_REPORT_BLKCIPHER
CRYPTOCFGA_REPORT_AEAD = C.CRYPTOCFGA_REPORT_AEAD
CRYPTOCFGA_REPORT_COMPRESS = C.CRYPTOCFGA_REPORT_COMPRESS
CRYPTOCFGA_REPORT_RNG = C.CRYPTOCFGA_REPORT_RNG
CRYPTOCFGA_REPORT_CIPHER = C.CRYPTOCFGA_REPORT_CIPHER
CRYPTOCFGA_REPORT_AKCIPHER = C.CRYPTOCFGA_REPORT_AKCIPHER
CRYPTOCFGA_REPORT_KPP = C.CRYPTOCFGA_REPORT_KPP
CRYPTOCFGA_REPORT_ACOMP = C.CRYPTOCFGA_REPORT_ACOMP
CRYPTOCFGA_STAT_LARVAL = C.CRYPTOCFGA_STAT_LARVAL
CRYPTOCFGA_STAT_HASH = C.CRYPTOCFGA_STAT_HASH
CRYPTOCFGA_STAT_BLKCIPHER = C.CRYPTOCFGA_STAT_BLKCIPHER
CRYPTOCFGA_STAT_AEAD = C.CRYPTOCFGA_STAT_AEAD
CRYPTOCFGA_STAT_COMPRESS = C.CRYPTOCFGA_STAT_COMPRESS
CRYPTOCFGA_STAT_RNG = C.CRYPTOCFGA_STAT_RNG
CRYPTOCFGA_STAT_CIPHER = C.CRYPTOCFGA_STAT_CIPHER
CRYPTOCFGA_STAT_AKCIPHER = C.CRYPTOCFGA_STAT_AKCIPHER
CRYPTOCFGA_STAT_KPP = C.CRYPTOCFGA_STAT_KPP
CRYPTOCFGA_STAT_ACOMP = C.CRYPTOCFGA_STAT_ACOMP
)

type CryptoUserAlg C.struct_crypto_user_alg

type CryptoStatAEAD C.struct_crypto_stat_aead

type CryptoStatAKCipher C.struct_crypto_stat_akcipher

type CryptoStatCipher C.struct_crypto_stat_cipher

type CryptoStatCompress C.struct_crypto_stat_compress

type CryptoStatHash C.struct_crypto_stat_hash

type CryptoStatKPP C.struct_crypto_stat_kpp

type CryptoStatRNG C.struct_crypto_stat_rng

type CryptoStatLarval C.struct_crypto_stat_larval

type CryptoReportLarval C.struct_crypto_report_larval

type CryptoReportHash C.struct_crypto_report_hash

type CryptoReportCipher C.struct_crypto_report_cipher

type CryptoReportBlkCipher C.struct_crypto_report_blkcipher

type CryptoReportAEAD C.struct_crypto_report_aead

type CryptoReportComp C.struct_crypto_report_comp

type CryptoReportRNG C.struct_crypto_report_rng

type CryptoReportAKCipher C.struct_crypto_report_akcipher

type CryptoReportKPP C.struct_crypto_report_kpp

type CryptoReportAcomp C.struct_crypto_report_acomp
2 changes: 2 additions & 0 deletions unix/mkerrors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ struct ltchars {
#include <linux/hdreg.h>
#include <linux/rtc.h>
#include <linux/if_xdp.h>
#include <linux/cryptouser.h>
#include <mtd/ubi-user.h>
#include <net/route.h>
Expand Down Expand Up @@ -499,6 +500,7 @@ ccflags="$@"
$2 ~ /^NFN/ ||
$2 ~ /^XDP_/ ||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
$2 ~ /^CRYPTO_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ ||
$2 ~/^PPPIOC/ ||
Expand Down
4 changes: 4 additions & 0 deletions unix/zerrors_linux_386.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_arm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_mips.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_mips64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_mips64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_mipsle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_ppc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_ppc64le.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_riscv64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_s390x.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions unix/zerrors_linux_sparc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 18eb32c

Please sign in to comment.