Header documentation changes and other small fixes
[crypto.git] / lib / silcasn1 / silcasn1_decode.c
index bcdd5e67932ad68651348e5dc216d4a6079844ac..a85f27402851ad5858e01191ab7408bb78a514fc 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2003 - 2007 Pekka Riikonen
+  Copyright (C) 2003 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silccrypto.h"
 #include "silcasn1.h"
 #include "silcber.h"
 
@@ -590,7 +590,7 @@ silc_asn1_decoder(SilcAsn1 asn1, SilcStack stack1, SilcAsn1Tag type,
            goto fail;
          }
 
-         *(*val) = (rdata[0] == 0xff ? TRUE : FALSE);
+         *(*val) = (rdata[0] != 0x00 ? TRUE : FALSE);
          break;
        }
 
@@ -948,6 +948,7 @@ SilcBool silc_asn1_decode(SilcAsn1 asn1, SilcBuffer src, ...)
       stack1 = asn1->stack1;
       asn1->stack1 = asn1->stack2;
       asn1->stack2 = stack1;
+      asn1->switched = !asn1->switched;
     }
   }