| // Copyright 2026 Google LLC | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // https://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| // | |
| #include "crypto/default/cms/oids.h" | |
| #include <cstddef> | |
| #include <cstdint> | |
| #include <cstring> | |
| #include "openssl/bytestring.h" | |
| namespace credentio_cms { | |
| // Returns true if the contents of data match expected. | |
| bool CompareOid(const CBS& data, const uint8_t expected[], | |
| size_t expected_length) { | |
| return CBS_len(&data) == expected_length && | |
| memcmp(CBS_data(&data), expected, expected_length) == 0; | |
| } | |
| bool CompareOid(const CBS& a, const CBS& b) { | |
| return CBS_len(&a) == CBS_len(&b) && | |
| memcmp(CBS_data(&a), CBS_data(&b), CBS_len(&a)) == 0; | |
| } | |
| } // namespace credentio_cms |