From 685c8c36efc4b1ef58ce8b41bb3a67edd8067144 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 31 Jul 2017 10:43:12 -0400 Subject: Add test for FFI keywrap, and constify args --- src/lib/ffi/ffi.h | 10 +++++----- src/lib/ffi/ffi_keywrap.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/ffi') diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h index 45cce37d2..7b14bdbd4 100644 --- a/src/lib/ffi/ffi.h +++ b/src/lib/ffi/ffi.h @@ -1057,13 +1057,13 @@ BOTAN_DLL int botan_x509_cert_allowed_usage(botan_x509_cert_t cert, unsigned int /** * Key wrapping as per RFC 3394 */ -BOTAN_DLL int botan_key_wrap3394(uint8_t key[], size_t key_len, - uint8_t kek[], size_t kek_len, +BOTAN_DLL int botan_key_wrap3394(const uint8_t key[], size_t key_len, + const uint8_t kek[], size_t kek_len, uint8_t wrapped_key[], size_t *wrapped_key_len); -BOTAN_DLL int botan_key_unwrap3394( uint8_t wrapped_key[], size_t wrapped_key_len, - uint8_t kek[], size_t kek_len, - uint8_t key[], size_t *key_len); +BOTAN_DLL int botan_key_unwrap3394(const uint8_t wrapped_key[], size_t wrapped_key_len, + const uint8_t kek[], size_t kek_len, + uint8_t key[], size_t *key_len); /* * TLS (WIP) diff --git a/src/lib/ffi/ffi_keywrap.cpp b/src/lib/ffi/ffi_keywrap.cpp index d881140d6..22bb5280a 100644 --- a/src/lib/ffi/ffi_keywrap.cpp +++ b/src/lib/ffi/ffi_keywrap.cpp @@ -15,8 +15,8 @@ extern "C" { using namespace Botan_FFI; -int botan_key_wrap3394(uint8_t key[], size_t key_len, - uint8_t kek[], size_t kek_len, +int botan_key_wrap3394(const uint8_t key[], size_t key_len, + const uint8_t kek[], size_t kek_len, uint8_t wrapped_key[], size_t* wrapped_key_len) { #if defined(BOTAN_HAS_RFC3394_KEYWRAP) @@ -31,8 +31,8 @@ int botan_key_wrap3394(uint8_t key[], size_t key_len, #endif } -int botan_key_unwrap3394(uint8_t wrapped_key[], size_t wrapped_key_len, - uint8_t kek[], size_t kek_len, +int botan_key_unwrap3394(const uint8_t wrapped_key[], size_t wrapped_key_len, + const uint8_t kek[], size_t kek_len, uint8_t key[], size_t* key_len) { #if defined(BOTAN_HAS_RFC3394_KEYWRAP) -- cgit v1.2.3