Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions crypto/pbkdf2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ##############################################################################
# apps/crypto/pbkdf2/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_CRYPTO_PBKDF2 OR CONFIG_FSUTILS_PASSWD)
nuttx_add_library(pbkdf2 STATIC)

target_sources(pbkdf2 PRIVATE pbkdf2_hmac_sha256.c)
target_include_directories(pbkdf2 PUBLIC ${CMAKE_CURRENT_LIST_DIR})

if(CONFIG_CRYPTO_MBEDTLS)
nuttx_add_dependencies(TARGET pbkdf2 DEPENDS mbedtls)
endif()
endif()
15 changes: 15 additions & 0 deletions crypto/pbkdf2/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config CRYPTO_PBKDF2
bool "PBKDF2-HMAC-SHA256 support"
default n
---help---
Enable a small, heap-free PBKDF2-HMAC-SHA256 implementation in
apps/crypto/pbkdf2. When Mbed TLS with MBEDTLS_PKCS5_C is also
enabled, that backend is used; otherwise a self-contained SHA-256
and HMAC implementation is compiled.

Selected automatically when password file support is enabled.
27 changes: 27 additions & 0 deletions crypto/pbkdf2/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
############################################################################
# apps/crypto/pbkdf2/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

ifneq ($(CONFIG_CRYPTO_PBKDF2),)
CONFIGURED_APPS += $(APPDIR)/crypto/pbkdf2
else ifneq ($(CONFIG_FSUTILS_PASSWD),)
CONFIGURED_APPS += $(APPDIR)/crypto/pbkdf2
endif
29 changes: 29 additions & 0 deletions crypto/pbkdf2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
############################################################################
# apps/crypto/pbkdf2/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include $(APPDIR)/Make.defs

CSRCS = pbkdf2_hmac_sha256.c

CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/crypto/pbkdf2

include $(APPDIR)/Application.mk
Loading
Loading