Changeset View
Changeset View
Standalone View
Standalone View
buffer.h
Show All 15 Lines | |||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
/* Emulation wrappers for legacy OpenSSH buffer API atop sshbuf */ | /* Emulation wrappers for legacy OpenSSH buffer API atop sshbuf */ | ||||
#ifndef BUFFER_H | #ifndef BUFFER_H | ||||
#define BUFFER_H | #define BUFFER_H | ||||
#include <pwd.h> | |||||
#include "sshbuf.h" | #include "sshbuf.h" | ||||
typedef struct sshbuf Buffer; | typedef struct sshbuf Buffer; | ||||
#define buffer_init(b) sshbuf_init(b) | #define buffer_init(b) sshbuf_init(b) | ||||
#define buffer_clear(b) sshbuf_reset(b) | #define buffer_clear(b) sshbuf_reset(b) | ||||
#define buffer_free(b) sshbuf_free(b) | #define buffer_free(b) sshbuf_free(b) | ||||
#define buffer_dump(b) sshbuf_dump(b, stderr) | #define buffer_dump(b) sshbuf_dump(b, stderr) | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#ifdef OPENSSL_HAS_ECC | #ifdef OPENSSL_HAS_ECC | ||||
#include <openssl/ec.h> | #include <openssl/ec.h> | ||||
int buffer_put_ecpoint_ret(Buffer *, const EC_GROUP *, const EC_POINT *); | int buffer_put_ecpoint_ret(Buffer *, const EC_GROUP *, const EC_POINT *); | ||||
void buffer_put_ecpoint(Buffer *, const EC_GROUP *, const EC_POINT *); | void buffer_put_ecpoint(Buffer *, const EC_GROUP *, const EC_POINT *); | ||||
int buffer_get_ecpoint_ret(Buffer *, const EC_GROUP *, EC_POINT *); | int buffer_get_ecpoint_ret(Buffer *, const EC_GROUP *, EC_POINT *); | ||||
void buffer_get_ecpoint(Buffer *, const EC_GROUP *, EC_POINT *); | void buffer_get_ecpoint(Buffer *, const EC_GROUP *, EC_POINT *); | ||||
#endif | #endif | ||||
void buffer_put_passwd(Buffer *, const struct passwd *); | |||||
cem: Probably second argument can be `const struct passwd *`, right? | |||||
Not Done Inline ActionsYes. sturct passwd * will never be changed in buffer_put_passwd. naito.yuichiro_gmail.com: Yes. `sturct passwd *` will never be changed in `buffer_put_passwd`.
I'll fix this. | |||||
struct passwd *buffer_get_passwd(Buffer *); | |||||
void buffer_free_passwd(struct passwd *); | |||||
#endif /* BUFFER_H */ | #endif /* BUFFER_H */ | ||||
Probably second argument can be const struct passwd *, right?