/*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
*
- * Licensed under the OpenSSL license (the "License"). You may not use
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
+/*
+ * Low level APIs are deprecated for public use, but still ok for internal use.
+ */
+#include "internal/deprecated.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef OPENSSL_NO_SM2
-# include "internal/sm2.h"
+# include "crypto/sm2.h"
static RAND_METHOD fake_rand;
static const RAND_METHOD *saved_rand;
goto done;
start_fake_rand(k_hex);
- sig = sm2_do_sign(key, EVP_sm3(), userid, (const uint8_t *)message, msg_len);
+ sig = sm2_do_sign(key, EVP_sm3(), (const uint8_t *)userid, strlen(userid),
+ (const uint8_t *)message, msg_len);
if (!TEST_ptr(sig)
|| !TEST_size_t_eq(fake_rand_bytes_offset, fake_rand_size)) {
restore_rand();
|| !TEST_BN_eq(s, sig_s))
goto done;
- ok = sm2_do_verify(key, EVP_sm3(), sig, userid, (const uint8_t *)message,
- msg_len);
+ ok = sm2_do_verify(key, EVP_sm3(), sig, (const uint8_t *)userid,
+ strlen(userid), (const uint8_t *)message, msg_len);
/* We goto done whether this passes or fails */
TEST_true(ok);