|
@@ -169,11 +169,20 @@ int verify_main(int argc, char **argv)
|
|
|
v_verbose = 1;
|
|
|
break;
|
|
|
case OPT_SM2ID:
|
|
|
- /* we assume the input is not a hex string */
|
|
|
+ if (sm2_id != NULL) {
|
|
|
+ BIO_printf(bio_err,
|
|
|
+ "Use one of the options 'sm2-hex-id' or 'sm2-id' \n");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
sm2_id = (unsigned char *)opt_arg();
|
|
|
sm2_idlen = strlen((const char *)sm2_id);
|
|
|
break;
|
|
|
case OPT_SM2HEXID:
|
|
|
+ if (sm2_id != NULL) {
|
|
|
+ BIO_printf(bio_err,
|
|
|
+ "Use one of the options 'sm2-hex-id' or 'sm2-id' \n");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
/* try to parse the input as hex string first */
|
|
|
sm2_free = 1;
|
|
|
sm2_id = OPENSSL_hexstr2buf(opt_arg(), (long *)&sm2_idlen);
|