Fixed bug where libfko would segfault if fko_get_spa_data() was called before fko_spa_data_final() was called (and successful). Added include of time.h in fko.h.
git-svn-id: file:///home/mbr/svn/fwknop/trunk@306 510a4753-2344-4c79-9c09-4d669213fbeb
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#ifndef FKO_H
|
||||
#define FKO_H 1
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -330,6 +330,11 @@ fko_get_spa_data(fko_ctx_t ctx, char **spa_data)
|
||||
if(!CTX_INITIALIZED(ctx))
|
||||
return(FKO_ERROR_CTX_NOT_INITIALIZED);
|
||||
|
||||
/* We expect to have encrypted data to process. If not, we bail.
|
||||
*/
|
||||
if(ctx->encrypted_msg == NULL || (strlen(ctx->encrypted_msg) < 1))
|
||||
return(FKO_ERROR_MISSING_ENCODED_DATA);
|
||||
|
||||
*spa_data = ctx->encrypted_msg;
|
||||
|
||||
/* Notice we omit the first 10 bytes if Rijndael encryption is
|
||||
|
||||
Reference in New Issue
Block a user