[libfko] added context initialized check to fko_decrypt_spa_data()
authorMichael Rash <mbr@cipherdyne.org>
Mon, 13 May 2013 00:49:00 +0000 (20:49 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Mon, 13 May 2013 00:49:00 +0000 (20:49 -0400)
lib/fko_encryption.c

index 0c19e7f..d7b4595 100644 (file)
@@ -542,6 +542,9 @@ fko_decrypt_spa_data(fko_ctx_t ctx, const char * const dec_key, const int key_le
 {
     int     enc_type, res;
 
+    if(!CTX_INITIALIZED(ctx))
+        return(FKO_ERROR_CTX_NOT_INITIALIZED);
+
     /* Get the (assumed) type of encryption used. This will also provide
      * some data validation.
     */