Giter Site home page Giter Site logo

[Help] about teslabtapi HOT 6 CLOSED

476793556 avatar 476793556 commented on June 17, 2024
[Help]

from teslabtapi.

Comments (6)

LexNastin avatar LexNastin commented on June 17, 2024

If I were to guess, I’d say that the problem is more than likely in your implementation. Specifically, the car is unable to decrypt your message. Perhaps you sent something wrong somewhere? Or maybe you encrypted with the wrong nonce? Perhaps you incremented the nonce integer but in are still using the original nonce array for encryption?

There isn’t enough context for me to help you much further, unless you send some code or something. Hope this helps.

from teslabtapi.

LexNastin avatar LexNastin commented on June 17, 2024

Also, no your ephemeral key didn’t change. I was testing for the past 2 years and am yet to see it change from the original value.

from teslabtapi.

476793556 avatar 476793556 commented on June 17, 2024

Thank you very much for your answer, which is enlightening to me. I also suspect that there is an error in the nonce recorded by myself. I will read your document again and test whether there is any instruction that can synchronize the nonce, so as to ensure that the nonce stored locally is consistent with that of the vehicle.

from teslabtapi.

LexNastin avatar LexNastin commented on June 17, 2024

What the problem here probably is if it’s the nonce isn’t that you’re sending a used nonce. No - the car would notify you of that. The problem is that you might be encrypting the message with a different nonce than you’re telling the car you’re encrypting with.

from teslabtapi.

476793556 avatar 476793556 commented on June 17, 2024

Hi, My encryption method was initially working fine, I could control the vehicle. However, after using it for some time, it would become ineffective. Previously, you suspected a problem with the counter, so I added a logic that when it becomes ineffective, it would request the counter from the vehicle and increment it by 1 for the next command. When the app starts, I obtain the counter from the vehicle and send the following command:

<ToVCSECMessage 0x282961800>: {
unsignedMessage {
InformationRequest {
informationRequestType: INFORMATION_REQUEST_TYPE_GET_COUNTER
keyId {
publicKeySHA1: "\340\247MO"
}
}
}
}

Upon successful execution, the vehicle responds with:

<FromVCSECMessage 0x13f6072d0>: {
sessionInfo {
counter: 255
}
}

At the same time, I also request the vehicle's status by sending:

<ToVCSECMessage 0x2829476c0>: {
unsignedMessage {
InformationRequest {
keyId {
publicKeySHA1: "\340\247MO"
}
}
}
}

The vehicle responds with:

<FromVCSECMessage 0x13f304080>: {
vehicleStatus {
vehicleSleepStatus: VEHICLE_SLEEP_STATUS_AWAKE
}
}

The problem arises when I send a command, such as opening the trunk:

<ToVCSECMessage 0x282948ba0>: {
signedMessage {
protobufMessageAsBytes: "\253_\206\260"
signature: "\216J\270\205v:\251(\254/H\332\242\2747;"
keyId: "\340\247MO"
counter: 256
}
}

At this point, I receive the following response:

<FromVCSECMessage 0x13f40b560>: {
commandStatus {
operationStatus: OPERATIONSTATUS_ERROR
signedMessageStatus {
counter: 256
signedMessageInformation: SIGNEDMESSAGE_INFORMATION_FAULT_AES_DECRYPT_AUTH
}
}
}

I also receive:

<FromVCSECMessage 0x13f304080>: {
sessionInfo {
publicKey: "\004#\315\0230\374\3657\371\241Ju\367\320\346\020\266z\303p'\322\206PS\267\304\027m\203\236\023\332\364\307\p0\320W\370\260\254\202Y\\026`r\261\346\223s(\356\256\005\264kH\320\335\033{y"
}
}

In other words, even though I synchronize the vehicle's counter, it does not solve the issue of ineffectiveness. Currently, I am at a loss, can you identify any problems from the provided information? I look forward to your response.

from teslabtapi.

476793556 avatar 476793556 commented on June 17, 2024

I found the problem and have fixed the bug now, thank you

from teslabtapi.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.