summaryrefslogtreecommitdiffstats
path: root/asn1_decoder.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-21 20:13:07 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-03-21 20:13:07 +0100
commit1c456cd3a5930c5ca90e0a494a6ef169ea019096 (patch)
tree02d28a8f4945a978bbf449d058d5e9ee05236646 /asn1_decoder.cpp
parentMerge "Add testcases for load_keys()." am: 110102f37e (diff)
parentMerge "verify_file: Add constness to a few addresses." (diff)
downloadandroid_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar.gz
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar.bz2
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar.lz
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar.xz
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.tar.zst
android_bootable_recovery-1c456cd3a5930c5ca90e0a494a6ef169ea019096.zip
Diffstat (limited to 'asn1_decoder.cpp')
-rw-r--r--asn1_decoder.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/asn1_decoder.cpp b/asn1_decoder.cpp
index e7aef781c..ca4ee5267 100644
--- a/asn1_decoder.cpp
+++ b/asn1_decoder.cpp
@@ -22,9 +22,9 @@
typedef struct asn1_context {
- size_t length;
- uint8_t* p;
- int app_type;
+ size_t length;
+ const uint8_t* p;
+ int app_type;
} asn1_context_t;
@@ -38,7 +38,7 @@ static const int kTagSequence = 0x30;
static const int kTagSet = 0x31;
static const int kTagConstructed = 0xA0;
-asn1_context_t* asn1_context_new(uint8_t* buffer, size_t length) {
+asn1_context_t* asn1_context_new(const uint8_t* buffer, size_t length) {
asn1_context_t* ctx = (asn1_context_t*) calloc(1, sizeof(asn1_context_t));
if (ctx == NULL) {
return NULL;
@@ -168,7 +168,7 @@ bool asn1_sequence_next(asn1_context_t* ctx) {
return true;
}
-bool asn1_oid_get(asn1_context_t* ctx, uint8_t** oid, size_t* length) {
+bool asn1_oid_get(asn1_context_t* ctx, const uint8_t** oid, size_t* length) {
if (get_byte(ctx) != kTagOid) {
return false;
}
@@ -179,7 +179,7 @@ bool asn1_oid_get(asn1_context_t* ctx, uint8_t** oid, size_t* length) {
return true;
}
-bool asn1_octet_string_get(asn1_context_t* ctx, uint8_t** octet_string, size_t* length) {
+bool asn1_octet_string_get(asn1_context_t* ctx, const uint8_t** octet_string, size_t* length) {
if (get_byte(ctx) != kTagOctetString) {
return false;
}