@@ -776,9 +776,8 @@ static int _write_arbitrary_data(const arbitrary_data_t* data)
776
776
sizeof (data -> bytes ));
777
777
if (res != OPTIGA_LIB_SUCCESS ) {
778
778
util_log ("could not write arbitrary %x" , res );
779
- return res ;
780
779
}
781
- return 0 ;
780
+ return res ;
782
781
}
783
782
#endif
784
783
@@ -981,7 +980,7 @@ static int _configure_object_arbitrary_data(void)
981
980
}
982
981
if (lcso >= LCSO_STATE_OPERATIONAL ) {
983
982
util_log ("_configure_object_arbitrary_data: already setup" );
984
- return 0 ;
983
+ return OPTIGA_LIB_SUCCESS ;
985
984
}
986
985
util_log ("_configure_object_arbitrary_data: setting up" );
987
986
@@ -994,11 +993,11 @@ static int _configure_object_arbitrary_data(void)
994
993
// Initialize arbitrary data, all zeroes.
995
994
const arbitrary_data_t arbitrary_data = {0 };
996
995
int write_res = _write_arbitrary_data (& arbitrary_data );
997
- if (write_res ) {
996
+ if (write_res != OPTIGA_LIB_SUCCESS ) {
998
997
util_log ("could not initialize arbitrary data" );
999
998
return write_res ;
1000
999
}
1001
- return 0 ;
1000
+ return OPTIGA_LIB_SUCCESS ;
1002
1001
}
1003
1002
1004
1003
static int _configure_object_counter (void )
@@ -1799,7 +1798,7 @@ bool optiga_u2f_counter_set(uint32_t counter)
1799
1798
return false;
1800
1799
}
1801
1800
data .fields .u2f_counter = counter ;
1802
- return _write_arbitrary_data (& data ) == 0 ;
1801
+ return _write_arbitrary_data (& data ) == OPTIGA_LIB_SUCCESS ;
1803
1802
}
1804
1803
#endif
1805
1804
@@ -1812,7 +1811,8 @@ bool optiga_u2f_counter_inc(uint32_t* counter)
1812
1811
}
1813
1812
data .fields .u2f_counter += 1 ;
1814
1813
* counter = data .fields .u2f_counter ;
1815
- return _write_arbitrary_data (& data );
1814
+
1815
+ return _write_arbitrary_data (& data ) == OPTIGA_LIB_SUCCESS ;
1816
1816
}
1817
1817
#endif
1818
1818
0 commit comments