Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <stdio.h> |
Christopher Ferris | 054d170 | 2014-11-06 14:34:24 -0800 | [diff] [blame] | 18 | #include <stdlib.h> |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 19 | |
| 20 | #ifdef _WIN32 |
Christopher Ferris | 054d170 | 2014-11-06 14:34:24 -0800 | [diff] [blame] | 21 | # ifndef WIN32_LEAN_AND_MEAN |
| 22 | # define WIN32_LEAN_AND_MEAN |
| 23 | # endif |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 24 | # include "windows.h" |
| 25 | # include "shlobj.h" |
| 26 | #else |
| 27 | # include <sys/types.h> |
| 28 | # include <sys/stat.h> |
| 29 | # include <unistd.h> |
| 30 | #endif |
| 31 | #include <string.h> |
| 32 | |
| 33 | #include "sysdeps.h" |
| 34 | #include "adb.h" |
| 35 | #include "adb_auth.h" |
| 36 | |
| 37 | /* HACK: we need the RSAPublicKey struct |
| 38 | * but RSA_verify conflits with openssl */ |
| 39 | #define RSA_verify RSA_verify_mincrypt |
| 40 | #include "mincrypt/rsa.h" |
| 41 | #undef RSA_verify |
| 42 | |
| 43 | #include <cutils/list.h> |
| 44 | |
| 45 | #include <openssl/evp.h> |
| 46 | #include <openssl/objects.h> |
| 47 | #include <openssl/pem.h> |
| 48 | #include <openssl/rsa.h> |
| 49 | #include <openssl/sha.h> |
| 50 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 51 | #if defined(OPENSSL_IS_BORINGSSL) |
| 52 | #include <openssl/base64.h> |
| 53 | #endif |
| 54 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 55 | #define TRACE_TAG TRACE_AUTH |
| 56 | |
| 57 | #define ANDROID_PATH ".android" |
Benoit Goby | cb37c50 | 2012-08-31 12:14:21 -0700 | [diff] [blame] | 58 | #define ADB_KEY_FILE "adbkey" |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 59 | |
| 60 | |
| 61 | struct adb_private_key { |
| 62 | struct listnode node; |
| 63 | RSA *rsa; |
| 64 | }; |
| 65 | |
| 66 | static struct listnode key_list; |
| 67 | |
| 68 | |
| 69 | /* Convert OpenSSL RSA private key to android pre-computed RSAPublicKey format */ |
| 70 | static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey) |
| 71 | { |
| 72 | int ret = 1; |
| 73 | unsigned int i; |
| 74 | |
| 75 | BN_CTX* ctx = BN_CTX_new(); |
| 76 | BIGNUM* r32 = BN_new(); |
| 77 | BIGNUM* rr = BN_new(); |
| 78 | BIGNUM* r = BN_new(); |
| 79 | BIGNUM* rem = BN_new(); |
| 80 | BIGNUM* n = BN_new(); |
| 81 | BIGNUM* n0inv = BN_new(); |
| 82 | |
| 83 | if (RSA_size(rsa) != RSANUMBYTES) { |
| 84 | ret = 0; |
| 85 | goto out; |
| 86 | } |
| 87 | |
| 88 | BN_set_bit(r32, 32); |
| 89 | BN_copy(n, rsa->n); |
| 90 | BN_set_bit(r, RSANUMWORDS * 32); |
| 91 | BN_mod_sqr(rr, r, n, ctx); |
| 92 | BN_div(NULL, rem, n, r32, ctx); |
| 93 | BN_mod_inverse(n0inv, rem, r32, ctx); |
| 94 | |
| 95 | pkey->len = RSANUMWORDS; |
| 96 | pkey->n0inv = 0 - BN_get_word(n0inv); |
| 97 | for (i = 0; i < RSANUMWORDS; i++) { |
| 98 | BN_div(rr, rem, rr, r32, ctx); |
| 99 | pkey->rr[i] = BN_get_word(rem); |
| 100 | BN_div(n, rem, n, r32, ctx); |
| 101 | pkey->n[i] = BN_get_word(rem); |
| 102 | } |
| 103 | pkey->exponent = BN_get_word(rsa->e); |
| 104 | |
| 105 | out: |
| 106 | BN_free(n0inv); |
| 107 | BN_free(n); |
| 108 | BN_free(rem); |
| 109 | BN_free(r); |
| 110 | BN_free(rr); |
| 111 | BN_free(r32); |
| 112 | BN_CTX_free(ctx); |
| 113 | |
| 114 | return ret; |
| 115 | } |
| 116 | |
| 117 | static void get_user_info(char *buf, size_t len) |
| 118 | { |
| 119 | char hostname[1024], username[1024]; |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 120 | int ret = -1; |
| 121 | |
| 122 | if (getenv("HOSTNAME") != NULL) { |
| 123 | strncpy(hostname, getenv("HOSTNAME"), sizeof(hostname)); |
| 124 | hostname[sizeof(hostname)-1] = '\0'; |
| 125 | ret = 0; |
| 126 | } |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 127 | |
| 128 | #ifndef _WIN32 |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 129 | if (ret < 0) |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 130 | ret = gethostname(hostname, sizeof(hostname)); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 131 | #endif |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 132 | if (ret < 0) |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 133 | strcpy(hostname, "unknown"); |
| 134 | |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 135 | ret = -1; |
| 136 | |
| 137 | if (getenv("LOGNAME") != NULL) { |
| 138 | strncpy(username, getenv("LOGNAME"), sizeof(username)); |
| 139 | username[sizeof(username)-1] = '\0'; |
| 140 | ret = 0; |
| 141 | } |
| 142 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 143 | #if !defined _WIN32 && !defined ADB_HOST_ON_TARGET |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 144 | if (ret < 0) |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 145 | ret = getlogin_r(username, sizeof(username)); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 146 | #endif |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 147 | if (ret < 0) |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 148 | strcpy(username, "unknown"); |
| 149 | |
| 150 | ret = snprintf(buf, len, " %s@%s", username, hostname); |
| 151 | if (ret >= (signed)len) |
| 152 | buf[len - 1] = '\0'; |
| 153 | } |
| 154 | |
| 155 | static int write_public_keyfile(RSA *private_key, const char *private_key_path) |
| 156 | { |
| 157 | RSAPublicKey pkey; |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 158 | FILE *outfile = NULL; |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 159 | char path[PATH_MAX], info[MAX_PAYLOAD]; |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 160 | uint8_t *encoded = NULL; |
| 161 | size_t encoded_length; |
| 162 | int ret = 0; |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 163 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 164 | if (snprintf(path, sizeof(path), "%s.pub", private_key_path) >= |
| 165 | (int)sizeof(path)) { |
| 166 | D("Path too long while writing public key\n"); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 167 | return 0; |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 168 | } |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 169 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 170 | if (!RSA_to_RSAPublicKey(private_key, &pkey)) { |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 171 | D("Failed to convert to publickey\n"); |
| 172 | return 0; |
| 173 | } |
| 174 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 175 | outfile = fopen(path, "w"); |
| 176 | if (!outfile) { |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 177 | D("Failed to open '%s'\n", path); |
| 178 | return 0; |
| 179 | } |
| 180 | |
| 181 | D("Writing public key to '%s'\n", path); |
| 182 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 183 | #if defined(OPENSSL_IS_BORINGSSL) |
| 184 | if (!EVP_EncodedLength(&encoded_length, sizeof(pkey))) { |
| 185 | D("Public key too large to base64 encode"); |
| 186 | goto out; |
| 187 | } |
| 188 | #else |
| 189 | /* While we switch from OpenSSL to BoringSSL we have to implement |
| 190 | * |EVP_EncodedLength| here. */ |
| 191 | encoded_length = 1 + ((sizeof(pkey) + 2) / 3 * 4); |
| 192 | #endif |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 193 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 194 | encoded = malloc(encoded_length); |
| 195 | if (encoded == NULL) { |
| 196 | D("Allocation failure"); |
| 197 | goto out; |
| 198 | } |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 199 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 200 | encoded_length = EVP_EncodeBlock(encoded, (uint8_t*) &pkey, sizeof(pkey)); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 201 | get_user_info(info, sizeof(info)); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 202 | |
Adam Langley | 29f6cdb | 2014-09-03 14:34:47 -0700 | [diff] [blame] | 203 | if (fwrite(encoded, encoded_length, 1, outfile) != 1 || |
| 204 | fwrite(info, strlen(info), 1, outfile) != 1) { |
| 205 | D("Write error while writing public key"); |
| 206 | goto out; |
| 207 | } |
| 208 | |
| 209 | ret = 1; |
| 210 | |
| 211 | out: |
| 212 | if (outfile != NULL) { |
| 213 | fclose(outfile); |
| 214 | } |
| 215 | if (encoded != NULL) { |
| 216 | free(encoded); |
| 217 | } |
| 218 | return ret; |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | static int generate_key(const char *file) |
| 222 | { |
| 223 | EVP_PKEY* pkey = EVP_PKEY_new(); |
| 224 | BIGNUM* exponent = BN_new(); |
| 225 | RSA* rsa = RSA_new(); |
Benoit Goby | cb37c50 | 2012-08-31 12:14:21 -0700 | [diff] [blame] | 226 | mode_t old_mask; |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 227 | FILE *f = NULL; |
| 228 | int ret = 0; |
| 229 | |
| 230 | D("generate_key '%s'\n", file); |
| 231 | |
| 232 | if (!pkey || !exponent || !rsa) { |
| 233 | D("Failed to allocate key\n"); |
| 234 | goto out; |
| 235 | } |
| 236 | |
| 237 | BN_set_word(exponent, RSA_F4); |
| 238 | RSA_generate_key_ex(rsa, 2048, exponent, NULL); |
| 239 | EVP_PKEY_set1_RSA(pkey, rsa); |
| 240 | |
Benoit Goby | cb37c50 | 2012-08-31 12:14:21 -0700 | [diff] [blame] | 241 | old_mask = umask(077); |
| 242 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 243 | f = fopen(file, "w"); |
| 244 | if (!f) { |
| 245 | D("Failed to open '%s'\n", file); |
Benoit Goby | cb37c50 | 2012-08-31 12:14:21 -0700 | [diff] [blame] | 246 | umask(old_mask); |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 247 | goto out; |
| 248 | } |
| 249 | |
Benoit Goby | cb37c50 | 2012-08-31 12:14:21 -0700 | [diff] [blame] | 250 | umask(old_mask); |
| 251 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 252 | if (!PEM_write_PrivateKey(f, pkey, NULL, NULL, 0, NULL, NULL)) { |
| 253 | D("Failed to write key\n"); |
| 254 | goto out; |
| 255 | } |
| 256 | |
| 257 | if (!write_public_keyfile(rsa, file)) { |
| 258 | D("Failed to write public key\n"); |
| 259 | goto out; |
| 260 | } |
| 261 | |
| 262 | ret = 1; |
| 263 | |
| 264 | out: |
| 265 | if (f) |
| 266 | fclose(f); |
| 267 | EVP_PKEY_free(pkey); |
| 268 | RSA_free(rsa); |
| 269 | BN_free(exponent); |
| 270 | return ret; |
| 271 | } |
| 272 | |
| 273 | static int read_key(const char *file, struct listnode *list) |
| 274 | { |
| 275 | struct adb_private_key *key; |
| 276 | FILE *f; |
| 277 | |
| 278 | D("read_key '%s'\n", file); |
| 279 | |
| 280 | f = fopen(file, "r"); |
| 281 | if (!f) { |
| 282 | D("Failed to open '%s'\n", file); |
| 283 | return 0; |
| 284 | } |
| 285 | |
| 286 | key = malloc(sizeof(*key)); |
| 287 | if (!key) { |
| 288 | D("Failed to alloc key\n"); |
| 289 | fclose(f); |
| 290 | return 0; |
| 291 | } |
| 292 | key->rsa = RSA_new(); |
| 293 | |
| 294 | if (!PEM_read_RSAPrivateKey(f, &key->rsa, NULL, NULL)) { |
| 295 | D("Failed to read key\n"); |
| 296 | fclose(f); |
| 297 | RSA_free(key->rsa); |
| 298 | free(key); |
| 299 | return 0; |
| 300 | } |
| 301 | |
| 302 | fclose(f); |
| 303 | list_add_tail(list, &key->node); |
| 304 | return 1; |
| 305 | } |
| 306 | |
| 307 | static int get_user_keyfilepath(char *filename, size_t len) |
| 308 | { |
| 309 | const char *format, *home; |
| 310 | char android_dir[PATH_MAX]; |
| 311 | struct stat buf; |
| 312 | #ifdef _WIN32 |
| 313 | char path[PATH_MAX]; |
| 314 | home = getenv("ANDROID_SDK_HOME"); |
| 315 | if (!home) { |
| 316 | SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, 0, path); |
| 317 | home = path; |
| 318 | } |
| 319 | format = "%s\\%s"; |
| 320 | #else |
| 321 | home = getenv("HOME"); |
| 322 | if (!home) |
| 323 | return -1; |
| 324 | format = "%s/%s"; |
| 325 | #endif |
| 326 | |
| 327 | D("home '%s'\n", home); |
| 328 | |
| 329 | if (snprintf(android_dir, sizeof(android_dir), format, home, |
| 330 | ANDROID_PATH) >= (int)sizeof(android_dir)) |
| 331 | return -1; |
| 332 | |
| 333 | if (stat(android_dir, &buf)) { |
| 334 | if (adb_mkdir(android_dir, 0750) < 0) { |
| 335 | D("Cannot mkdir '%s'", android_dir); |
| 336 | return -1; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | return snprintf(filename, len, format, android_dir, ADB_KEY_FILE); |
| 341 | } |
| 342 | |
| 343 | static int get_user_key(struct listnode *list) |
| 344 | { |
| 345 | struct stat buf; |
| 346 | char path[PATH_MAX]; |
| 347 | int ret; |
| 348 | |
| 349 | ret = get_user_keyfilepath(path, sizeof(path)); |
| 350 | if (ret < 0 || ret >= (signed)sizeof(path)) { |
| 351 | D("Error getting user key filename"); |
| 352 | return 0; |
| 353 | } |
| 354 | |
| 355 | D("user key '%s'\n", path); |
| 356 | |
| 357 | if (stat(path, &buf) == -1) { |
| 358 | if (!generate_key(path)) { |
| 359 | D("Failed to generate new key\n"); |
| 360 | return 0; |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | return read_key(path, list); |
| 365 | } |
| 366 | |
| 367 | static void get_vendor_keys(struct listnode *list) |
| 368 | { |
| 369 | const char *adb_keys_path; |
| 370 | char keys_path[MAX_PAYLOAD]; |
| 371 | char *path; |
| 372 | char *save; |
| 373 | struct stat buf; |
| 374 | |
| 375 | adb_keys_path = getenv("ADB_VENDOR_KEYS"); |
| 376 | if (!adb_keys_path) |
| 377 | return; |
| 378 | strncpy(keys_path, adb_keys_path, sizeof(keys_path)); |
| 379 | |
| 380 | path = adb_strtok_r(keys_path, ENV_PATH_SEPARATOR_STR, &save); |
| 381 | while (path) { |
| 382 | D("Reading: '%s'\n", path); |
| 383 | |
| 384 | if (stat(path, &buf)) |
| 385 | D("Can't read '%s'\n", path); |
| 386 | else if (!read_key(path, list)) |
| 387 | D("Failed to read '%s'\n", path); |
| 388 | |
| 389 | path = adb_strtok_r(NULL, ENV_PATH_SEPARATOR_STR, &save); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | int adb_auth_sign(void *node, void *token, size_t token_size, void *sig) |
| 394 | { |
| 395 | unsigned int len; |
| 396 | struct adb_private_key *key = node_to_item(node, struct adb_private_key, node); |
| 397 | |
Sami Tolvanen | b92a35c | 2015-01-27 16:48:35 +0000 | [diff] [blame] | 398 | if (token_size != TOKEN_SIZE) { |
| 399 | D("Unexpected token size %zd\n", token_size); |
| 400 | return 0; |
| 401 | } |
| 402 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 403 | if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) { |
| 404 | return 0; |
| 405 | } |
| 406 | |
| 407 | D("adb_auth_sign len=%d\n", len); |
| 408 | return (int)len; |
| 409 | } |
| 410 | |
| 411 | void *adb_auth_nextkey(void *current) |
| 412 | { |
| 413 | struct listnode *item; |
| 414 | |
| 415 | if (list_empty(&key_list)) |
| 416 | return NULL; |
| 417 | |
| 418 | if (!current) |
| 419 | return list_head(&key_list); |
| 420 | |
| 421 | list_for_each(item, &key_list) { |
| 422 | if (item == current) { |
| 423 | /* current is the last item, we tried all the keys */ |
| 424 | if (item->next == &key_list) |
| 425 | return NULL; |
| 426 | return item->next; |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | return NULL; |
| 431 | } |
| 432 | |
| 433 | int adb_auth_get_userkey(unsigned char *data, size_t len) |
| 434 | { |
| 435 | char path[PATH_MAX]; |
| 436 | char *file; |
| 437 | int ret; |
| 438 | |
| 439 | ret = get_user_keyfilepath(path, sizeof(path) - 4); |
| 440 | if (ret < 0 || ret >= (signed)(sizeof(path) - 4)) { |
| 441 | D("Error getting user key filename"); |
| 442 | return 0; |
| 443 | } |
| 444 | strcat(path, ".pub"); |
| 445 | |
| 446 | file = load_file(path, (unsigned*)&ret); |
| 447 | if (!file) { |
| 448 | D("Can't load '%s'\n", path); |
| 449 | return 0; |
| 450 | } |
| 451 | |
| 452 | if (len < (size_t)(ret + 1)) { |
| 453 | D("%s: Content too large ret=%d\n", path, ret); |
| 454 | return 0; |
| 455 | } |
| 456 | |
| 457 | memcpy(data, file, ret); |
| 458 | data[ret] = '\0'; |
| 459 | |
| 460 | return ret + 1; |
| 461 | } |
| 462 | |
Nick Kralevich | 6183c96 | 2014-11-13 15:17:29 -0800 | [diff] [blame] | 463 | int adb_auth_keygen(const char* filename) { |
| 464 | adb_trace_mask |= (1 << TRACE_AUTH); |
| 465 | return (generate_key(filename) == 0); |
| 466 | } |
| 467 | |
Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 468 | void adb_auth_init(void) |
| 469 | { |
| 470 | int ret; |
| 471 | |
| 472 | D("adb_auth_init\n"); |
| 473 | |
| 474 | list_init(&key_list); |
| 475 | |
| 476 | ret = get_user_key(&key_list); |
| 477 | if (!ret) { |
| 478 | D("Failed to get user key\n"); |
| 479 | return; |
| 480 | } |
| 481 | |
| 482 | get_vendor_keys(&key_list); |
| 483 | } |