Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nitpicks #589

Merged
merged 3 commits into from
Oct 12, 2023
Merged
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
1 change: 1 addition & 0 deletions keygen/keygen_network.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <string.h>

#include "crypto.h"
#include "crypto_dh.h"
#include "crypto_verify_bytes.h"
#include "keygen.h"
Expand Down
3 changes: 2 additions & 1 deletion lib/crypto/crypto_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stddef.h>

#include <openssl/bn.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/opensslv.h>
Expand Down Expand Up @@ -197,7 +198,7 @@ crypto_compat_RSA_export(RSA * key, const BIGNUM ** n, const BIGNUM ** e,
* Generate a key pair.
*/
RSA *
crypto_compat_RSA_generate_key()
crypto_compat_RSA_generate_key(void)
{
RSA * key;

Expand Down
3 changes: 2 additions & 1 deletion lib/crypto/crypto_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ int crypto_file_init_keys(void);

/**
* crypto_MGF1(seed, seedlen, buf, buflen):
* The MGF1 mask generation function, as specified in RFC 3447.
* The MGF1 mask generation function, as specified in RFC 3447 section B.2.1,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had this change laying around for over a year, but it never seemed important enough to include it in a PR.

I forget why I was looking up the details of it, but when I found the right section, it occurred to me that being a bit more specific in the API comment would have saved me some time.
https://datatracker.ietf.org/doc/html/rfc3447#appendix-B.2.1

* using SHA256 as the hash function.
*/
void crypto_MGF1(uint8_t *, size_t, uint8_t *, size_t);

Expand Down
3 changes: 2 additions & 1 deletion lib/crypto/crypto_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

/**
* crypto_MGF1(seed, seedlen, buf, buflen):
* The MGF1 mask generation function, as specified in RFC 3447.
* The MGF1 mask generation function, as specified in RFC 3447 section B.2.1,
* using SHA256 as the hash function.
*/
void
crypto_MGF1(uint8_t * seed, size_t seedlen, uint8_t * buf, size_t buflen)
Expand Down
2 changes: 2 additions & 0 deletions lib/netproto/netproto.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <sys/time.h>

#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions tar/chunks/chunks_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "chunks_internal.h"
#include "hexify.h"
#include "rwhashtab.h"
#include "storage.h"
#include "warnp.h"

#include "chunks.h"
Expand Down
1 change: 1 addition & 0 deletions tar/multitape/multitape_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>

#include "chunks.h"
#include "crypto.h"
#include "crypto_verify_bytes.h"
#include "storage.h"
Expand Down
2 changes: 2 additions & 0 deletions tar/multitape/multitape_metaindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
#include <stdlib.h>
#include <string.h>

#include "chunks.h"
#include "crypto.h"
#include "crypto_verify_bytes.h"
#include "storage.h"
#include "sysendian.h"
#include "warnp.h"

Expand Down
1 change: 1 addition & 0 deletions tar/multitape/multitape_recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdint.h>

#include "multitape_internal.h"
#include "storage.h"

#include "multitape.h"

Expand Down
1 change: 1 addition & 0 deletions tar/storage/storage_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "netpacket.h"
#include "netproto.h"
#include "storage_internal.h"
#include "tsnetwork.h"
#include "warnp.h"

#include "storage.h"
Expand Down
1 change: 1 addition & 0 deletions tar/storage/storage_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "netproto.h"
#include "storage_internal.h"
#include "sysendian.h"
#include "tsnetwork.h"
#include "warnp.h"

#include "storage.h"
Expand Down
1 change: 1 addition & 0 deletions tar/storage/storage_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "netproto.h"
#include "storage_internal.h"
#include "sysendian.h"
#include "tsnetwork.h"
#include "warnp.h"

#include "storage.h"
Expand Down
2 changes: 1 addition & 1 deletion tar/storage/storage_read_cache.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef STORAGE_READ_CACHE_H_
#define STORAGE_READ_CACHE_H_

#include <stdint.h>
#include <stddef.h>
#include <stdint.h>

/**
* storage_read_cache_init(void):
Expand Down
1 change: 1 addition & 0 deletions tar/storage/storage_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "crypto_entropy.h"
#include "netpacket.h"
#include "netproto.h"
#include "tsnetwork.h"
#include "warnp.h"

#include "storage.h"
Expand Down
1 change: 1 addition & 0 deletions tar/storage/storage_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "netproto.h"
#include "storage_internal.h"
#include "tarsnap_opt.h"
#include "tsnetwork.h"
#include "warnp.h"

#include "storage.h"
Expand Down