os400qc3.c: constify libssh2_os400qc3_hash_update() data parameter. (#469)
Files: os400qc3.c, os400qc3.h Notes: Fixes building on OS400. #426 Credit: Reported-by: hjindra on github, dev by Monnerat
Этот коммит содержится в:
родитель
6e0f17f672
Коммит
4e75a59e29
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2016 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
* Copyright (C) 2015-2016 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||||
|
* Copyright (C) 2020 Patrick Monnerat <patrick@monnerat.net>.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
@ -965,7 +966,7 @@ libssh2_os400qc3_hash_init(Qc3_Format_ALGD0100_T *x, unsigned int algorithm)
|
|||||||
|
|
||||||
void
|
void
|
||||||
libssh2_os400qc3_hash_update(Qc3_Format_ALGD0100_T *ctx,
|
libssh2_os400qc3_hash_update(Qc3_Format_ALGD0100_T *ctx,
|
||||||
unsigned char *data, int len)
|
const unsigned char *data, int len)
|
||||||
{
|
{
|
||||||
char dummy[64];
|
char dummy[64];
|
||||||
|
|
||||||
@ -995,7 +996,7 @@ libssh2_os400qc3_hash(const unsigned char *message, unsigned long len,
|
|||||||
if(!libssh2_os400qc3_hash_init(&ctx, algo))
|
if(!libssh2_os400qc3_hash_init(&ctx, algo))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
libssh2_os400qc3_hash_update(&ctx, (unsigned char *) message, len);
|
libssh2_os400qc3_hash_update(&ctx, message, len);
|
||||||
libssh2_os400qc3_hash_final(&ctx, out);
|
libssh2_os400qc3_hash_final(&ctx, out);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1390,8 +1391,7 @@ pbkdf1(LIBSSH2_SESSION *session, char **dk, const unsigned char *passphrase,
|
|||||||
|
|
||||||
/* Initial hash. */
|
/* Initial hash. */
|
||||||
libssh2_os400qc3_hash_init(&hctx, pkcs5->hash);
|
libssh2_os400qc3_hash_init(&hctx, pkcs5->hash);
|
||||||
libssh2_os400qc3_hash_update(&hctx, (unsigned char *) passphrase,
|
libssh2_os400qc3_hash_update(&hctx, passphrase, strlen(passphrase));
|
||||||
strlen(passphrase));
|
|
||||||
hctx.Final_Op_Flag = Qc3_Final;
|
hctx.Final_Op_Flag = Qc3_Final;
|
||||||
Qc3CalculateHash((char *) pkcs5->salt, &len, Qc3_Data, (char *) &hctx,
|
Qc3CalculateHash((char *) pkcs5->salt, &len, Qc3_Data, (char *) &hctx,
|
||||||
Qc3_Alg_Token, anycsp, NULL, *dk, (char *) &ecnull);
|
Qc3_Alg_Token, anycsp, NULL, *dk, (char *) &ecnull);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2016 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
* Copyright (C) 2015-2016 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||||
|
* Copyright (C) 2020 Patrick Monnerat <patrick@monnerat.net>.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
@ -355,7 +356,8 @@ extern void _libssh2_os400qc3_crypto_dtor(_libssh2_os400qc3_crypto_ctx *x);
|
|||||||
extern int libssh2_os400qc3_hash_init(Qc3_Format_ALGD0100_T *x,
|
extern int libssh2_os400qc3_hash_init(Qc3_Format_ALGD0100_T *x,
|
||||||
unsigned int algo);
|
unsigned int algo);
|
||||||
extern void libssh2_os400qc3_hash_update(Qc3_Format_ALGD0100_T *ctx,
|
extern void libssh2_os400qc3_hash_update(Qc3_Format_ALGD0100_T *ctx,
|
||||||
unsigned char *data, int len);
|
const unsigned char *data,
|
||||||
|
int len);
|
||||||
extern void libssh2_os400qc3_hash_final(Qc3_Format_ALGD0100_T *ctx,
|
extern void libssh2_os400qc3_hash_final(Qc3_Format_ALGD0100_T *ctx,
|
||||||
unsigned char *out);
|
unsigned char *out);
|
||||||
extern int libssh2_os400qc3_hash(const unsigned char *message,
|
extern int libssh2_os400qc3_hash(const unsigned char *message,
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user